D3DMessageUtils.h (1421B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef _include_gfx_ipc_D3DMessageUtils_h__ 7 #define _include_gfx_ipc_D3DMessageUtils_h__ 8 9 #include "chrome/common/ipc_message_utils.h" 10 #include "ipc/IPCMessageUtils.h" 11 12 // Can't include dxgi.h, since it leaks random identifiers and #defines, and 13 // IPDL causes this file to be #included all over. 14 typedef struct DXGI_ADAPTER_DESC DXGI_ADAPTER_DESC; 15 16 struct DxgiAdapterDesc { 17 #if defined(XP_WIN) 18 WCHAR Description[128]; 19 UINT VendorId; 20 UINT DeviceId; 21 UINT SubSysId; 22 UINT Revision; 23 SIZE_T DedicatedVideoMemory; 24 SIZE_T DedicatedSystemMemory; 25 SIZE_T SharedSystemMemory; 26 LUID AdapterLuid; 27 28 static const DxgiAdapterDesc& From(const DXGI_ADAPTER_DESC& aDesc); 29 const DXGI_ADAPTER_DESC& ToDesc() const; 30 #endif 31 32 bool operator==(const DxgiAdapterDesc& aOther) const; 33 }; 34 35 namespace IPC { 36 37 template <> 38 struct ParamTraits<DxgiAdapterDesc> { 39 typedef DxgiAdapterDesc paramType; 40 static void Write(MessageWriter* aWriter, const paramType& aParam); 41 static bool Read(MessageReader* aReader, paramType* aResult); 42 }; 43 44 } // namespace IPC 45 46 #endif // _include_gfx_ipc_D3DMessageUtils_h__