diff options
author | Luca Barbieri <[email protected]> | 2010-09-23 13:44:22 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-09-23 16:06:02 +0200 |
commit | 6c598c78bd17642d731cf57b8369cc794f64ba2f (patch) | |
tree | 27671d42b851a95b1b03bd44d039f75ac505c6e3 /src/gallium/state_trackers/d3d1x/d3d1xstutil | |
parent | e5ae4588d150a179974a812887f3b6445d8e2f34 (diff) |
d3d1x: normalize whitespace
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/d3d1xstutil')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h | 260 |
1 files changed, 130 insertions, 130 deletions
diff --git a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h index 974518a5ce3..eebabaa9af5 100644 --- a/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h +++ b/src/gallium/state_trackers/d3d1x/d3d1xstutil/include/d3d1xstutil.h @@ -200,7 +200,7 @@ extern "C" * with are unsafe regarding vtable layout. * In particular, consider the case where we try to delete GalliumComObject<ID3D11Texture2D> * with a pointer to GalliumComObject<ID3D11Resource>. - * Since we think that this is a GalliumComObject<ID3D11Resource>, we'll look for the + * Since we think that this is a GalliumComObject<ID3D11Resource>, we'll look for the * destructor in the vtable slot immediately after the ID3D11Resource vtable, but this is * actually an ID3D11Texture2D function implemented by the object! * @@ -441,7 +441,7 @@ struct GalliumComObject : public Base virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, - void **ppvObject) + void **ppvObject) { /* see the initial comment for an explaination of this magic trick */ if(&riid == &IID_MAGIC_DELETE_THIS) @@ -487,9 +487,9 @@ struct GalliumMultiComObject : public BaseClass, SecondaryInterface return E_NOINTERFACE; } - virtual HRESULT STDMETHODCALLTYPE QueryInterface( + virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, - void **ppvObject) + void **ppvObject) { /* see the initial comment for an explaination of this magic trick */ if(&riid == &IID_MAGIC_DELETE_THIS) @@ -836,77 +836,77 @@ struct GalliumPrivateDataComObject : public GalliumComObject<Base, RefCnt> } HRESULT get_private_data( - __in REFGUID guid, - __inout UINT *pDataSize, - __out_bcount_opt(*pDataSize) void *pData) - { + __in REFGUID guid, + __inout UINT *pDataSize, + __out_bcount_opt(*pDataSize) void *pData) + { lock_t<mutex_t> lock(private_data_mutex); - private_data_map_t::iterator i = private_data_map.find(guid); - *pDataSize = 0; - if(i == private_data_map.end()) - return DXGI_ERROR_NOT_FOUND; - if(i->second.second == ~0u) - { - /* TODO: is GetPrivateData on interface data supposed to do this? */ - if(*pDataSize < sizeof(void*)) - return E_INVALIDARG; - if(pData) - { - memcpy(pData, &i->second.first, sizeof(void*)); + private_data_map_t::iterator i = private_data_map.find(guid); + *pDataSize = 0; + if(i == private_data_map.end()) + return DXGI_ERROR_NOT_FOUND; + if(i->second.second == ~0u) + { + /* TODO: is GetPrivateData on interface data supposed to do this? */ + if(*pDataSize < sizeof(void*)) + return E_INVALIDARG; + if(pData) + { + memcpy(pData, &i->second.first, sizeof(void*)); ((IUnknown*)i->second.first)->AddRef(); - } - *pDataSize = sizeof(void*); - } - else - { - unsigned size = std::min(*pDataSize, i->second.second); - if(pData) - memcpy(pData, i->second.first, size); - *pDataSize = size; - } - return S_OK; - } - - HRESULT set_private_data( - __in REFGUID guid, - __in UINT DataSize, - __in_bcount_opt( DataSize ) const void *pData) - { - void* p = 0; - - if(DataSize && pData) - { - p = malloc(DataSize); - if(!p) - return E_OUTOFMEMORY; - } - - lock_t<mutex_t> lock(private_data_mutex); - std::pair<void*, unsigned>& v = private_data_map[guid]; - if(v.first) - { - if(v.second == ~0u) - ((IUnknown*)v.first)->Release(); - else - free(v.first); - } - if(DataSize && pData) - { - memcpy(p, pData, DataSize); - v.first = p; - v.second = DataSize; - } - else - private_data_map.erase(guid); - return S_OK; - } - - HRESULT set_private_data_interface( - __in REFGUID guid, - __in_opt const IUnknown *pData) - { - lock_t<mutex_t> lock(private_data_mutex); - std::pair<void*, unsigned>& v = private_data_map[guid]; + } + *pDataSize = sizeof(void*); + } + else + { + unsigned size = std::min(*pDataSize, i->second.second); + if(pData) + memcpy(pData, i->second.first, size); + *pDataSize = size; + } + return S_OK; + } + + HRESULT set_private_data( + __in REFGUID guid, + __in UINT DataSize, + __in_bcount_opt( DataSize ) const void *pData) + { + void* p = 0; + + if(DataSize && pData) + { + p = malloc(DataSize); + if(!p) + return E_OUTOFMEMORY; + } + + lock_t<mutex_t> lock(private_data_mutex); + std::pair<void*, unsigned>& v = private_data_map[guid]; + if(v.first) + { + if(v.second == ~0u) + ((IUnknown*)v.first)->Release(); + else + free(v.first); + } + if(DataSize && pData) + { + memcpy(p, pData, DataSize); + v.first = p; + v.second = DataSize; + } + else + private_data_map.erase(guid); + return S_OK; + } + + HRESULT set_private_data_interface( + __in REFGUID guid, + __in_opt const IUnknown *pData) + { + lock_t<mutex_t> lock(private_data_mutex); + std::pair<void*, unsigned>& v = private_data_map[guid]; if(v.first) { if(v.second == ~0u) @@ -923,30 +923,30 @@ struct GalliumPrivateDataComObject : public GalliumComObject<Base, RefCnt> else private_data_map.erase(guid); return S_OK; - } + } virtual HRESULT STDMETHODCALLTYPE GetPrivateData( - __in REFGUID guid, - __inout UINT *pDataSize, - __out_bcount_opt(*pDataSize) void *pData) - { + __in REFGUID guid, + __inout UINT *pDataSize, + __out_bcount_opt(*pDataSize) void *pData) + { return get_private_data(guid, pDataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateData( - __in REFGUID guid, - __in UINT DataSize, - __in_bcount_opt( DataSize ) const void *pData) - { - return set_private_data(guid, DataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( - __in REFGUID guid, - __in_opt const IUnknown *pData) - { - return set_private_data_interface(guid, pData); - } + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + __in REFGUID guid, + __in UINT DataSize, + __in_bcount_opt( DataSize ) const void *pData) + { + return set_private_data(guid, DataSize, pData); + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + __in REFGUID guid, + __in_opt const IUnknown *pData) + { + return set_private_data_interface(guid, pData); + } }; template<typename BaseClass, typename SecondaryInterface> @@ -954,27 +954,27 @@ struct GalliumMultiPrivateDataComObject : public GalliumMultiComObject<BaseClass { // we could avoid this duplication, but the increased complexity to do so isn't worth it virtual HRESULT STDMETHODCALLTYPE GetPrivateData( - __in REFGUID guid, - __inout UINT *pDataSize, - __out_bcount_opt(*pDataSize) void *pData) - { + __in REFGUID guid, + __inout UINT *pDataSize, + __out_bcount_opt(*pDataSize) void *pData) + { return BaseClass::get_private_data(guid, pDataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateData( - __in REFGUID guid, - __in UINT DataSize, - __in_bcount_opt( DataSize ) const void *pData) - { - return BaseClass::set_private_data(guid, DataSize, pData); - } - - virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( - __in REFGUID guid, - __in_opt const IUnknown *pData) - { - return BaseClass::set_private_data_interface(guid, pData); - } + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + __in REFGUID guid, + __in UINT DataSize, + __in_bcount_opt( DataSize ) const void *pData) + { + return BaseClass::set_private_data(guid, DataSize, pData); + } + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + __in REFGUID guid, + __in_opt const IUnknown *pData) + { + return BaseClass::set_private_data_interface(guid, pData); + } }; #define DXGI_FORMAT_COUNT 100 @@ -1014,23 +1014,23 @@ struct GalliumDXGIDevice : public GalliumMultiPrivateDataComObject<Base, IDXGIDe adapter = p_adapter; } - virtual HRESULT STDMETHODCALLTYPE GetParent( - __in REFIID riid, - __out void **ppParent) - { - return adapter.p->QueryInterface(riid, ppParent); - } + virtual HRESULT STDMETHODCALLTYPE GetParent( + __in REFIID riid, + __out void **ppParent) + { + return adapter.p->QueryInterface(riid, ppParent); + } virtual HRESULT STDMETHODCALLTYPE GetAdapter( - __out IDXGIAdapter **pAdapter) + __out IDXGIAdapter **pAdapter) { *pAdapter = adapter.ref(); return S_OK; } virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency( - __in_ecount(NumResources) IUnknown *const *ppResources, - __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, + __in_ecount(NumResources) IUnknown *const *ppResources, + __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, UINT NumResources) { for(unsigned i = 0; i < NumResources; ++i) @@ -1046,7 +1046,7 @@ struct GalliumDXGIDevice : public GalliumMultiPrivateDataComObject<Base, IDXGIDe } virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority( - __out INT *pPriority) + __out INT *pPriority) { *pPriority = priority; return S_OK; @@ -1060,12 +1060,12 @@ struct GalliumDXGIDevice : public GalliumMultiPrivateDataComObject<Base, IDXGIDe return S_OK; } - virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency( - UINT MaxLatency) - { - max_latency = MaxLatency; - return S_OK; - } + virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency( + UINT MaxLatency) + { + max_latency = MaxLatency; + return S_OK; + } }; COM_INTERFACE(ID3D10Blob, IUnknown); |