Module: wine Branch: master Commit: dd5fc79f56e2b2447da8db61fbeeb034ef03eb95 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd5fc79f56e2b2447da8db61fb...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Dec 4 11:50:48 2009 +0100
wined3d: The stateblock doesn't really need a parent.
---
dlls/wined3d/device.c | 2 +- dlls/wined3d/stateblock.c | 12 +----------- dlls/wined3d/wined3d_private.h | 5 ++--- include/wine/wined3d.idl | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 98c5002..cefabea 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -605,7 +605,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface, return E_OUTOFMEMORY; }
- hr = stateblock_init(object, This, type, parent); + hr = stateblock_init(object, This, type); if (FAILED(hr)) { WARN("Failed to initialize stateblock, hr %#x.\n", hr); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 9082c3d..41fca71 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -535,13 +535,6 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) { /********************************************************** * IWineD3DStateBlockImpl parts follows **********************************************************/ -static HRESULT WINAPI IWineD3DStateBlockImpl_GetParent(IWineD3DStateBlock *iface, IUnknown **pParent) { - IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; - IUnknown_AddRef(This->parent); - *pParent = This->parent; - return WINED3D_OK; -} - static HRESULT WINAPI IWineD3DStateBlockImpl_GetDevice(IWineD3DStateBlock *iface, IWineD3DDevice** ppDevice){
IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; @@ -1328,22 +1321,19 @@ static const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl = IWineD3DStateBlockImpl_AddRef, IWineD3DStateBlockImpl_Release, /* IWineD3DStateBlock */ - IWineD3DStateBlockImpl_GetParent, IWineD3DStateBlockImpl_GetDevice, IWineD3DStateBlockImpl_Capture, IWineD3DStateBlockImpl_Apply, IWineD3DStateBlockImpl_InitStartupStateBlock };
-HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *device, - WINED3DSTATEBLOCKTYPE type, IUnknown *parent) +HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *device, WINED3DSTATEBLOCKTYPE type) { unsigned int i; HRESULT hr;
stateblock->lpVtbl = &IWineD3DStateBlock_Vtbl; stateblock->ref = 1; - stateblock->parent = parent; stateblock->wineD3DDevice = device; stateblock->blockType = type;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7bb5b71..39519a1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2194,7 +2194,6 @@ struct IWineD3DStateBlockImpl LONG ref; /* Note: Ref counting not required */
/* IWineD3DStateBlock information */ - IUnknown *parent; IWineD3DDeviceImpl *wineD3DDevice; WINED3DSTATEBLOCKTYPE blockType;
@@ -2293,8 +2292,8 @@ struct IWineD3DStateBlockImpl unsigned int num_contained_sampler_states; };
-HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *device, - WINED3DSTATEBLOCKTYPE type, IUnknown *parent) DECLSPEC_HIDDEN; +HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, + IWineD3DDeviceImpl *device, WINED3DSTATEBLOCKTYPE type) DECLSPEC_HIDDEN; void stateblock_init_contained_states(IWineD3DStateBlockImpl *object) DECLSPEC_HIDDEN;
/* Direct3D terminology with little modifications. We do not have an issued state diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 0658b74..da21af8 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -2724,7 +2724,7 @@ interface IWineD3DVertexDeclaration : IWineD3DBase local, uuid(83b073ce-6f30-11d9-c687-00046142c14f) ] -interface IWineD3DStateBlock : IWineD3DBase +interface IWineD3DStateBlock : IUnknown { HRESULT GetDevice( [out] IWineD3DDevice **device