From ebe274feed73a74c5d9c34db96ac0244c698f89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 3 Mar 2007 15:19:41 +0100 Subject: [PATCH] wined3d: Remove IWineD3DSurface::SetPBufferState. The method is removed because it does not really help with anything. It should not be exported from wined3d, there is no need for the other libs to call it. It does not help abstraction and code simplification in any way because it is very specific and the code calling it has to know what is happening in the surface to use this method. --- dlls/wined3d/context.c | 6 ++++-- dlls/wined3d/surface.c | 20 -------------------- dlls/wined3d/surface_gdi.c | 1 - dlls/wined3d/wined3d_private.h | 1 - include/wine/wined3d_interface.h | 2 -- 5 files changed, 4 insertions(+), 26 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 6b001204699..b926af0e1e8 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -709,10 +709,12 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU /* Do that before switching the context: * Read the back buffer of the old drawable into the destination texture */ - IWineD3DSurface_SetPBufferState(This->lastActiveRenderTarget, TRUE /* inPBuffer */, FALSE /* inTexture */); + ((IWineD3DSurfaceImpl *) This->lastActiveRenderTarget)->Flags |= SFLAG_INPBUFFER; + ((IWineD3DSurfaceImpl *) This->lastActiveRenderTarget)->Flags &= ~SFLAG_INTEXTURE; IWineD3DSurface_AddDirtyRect(This->lastActiveRenderTarget, NULL); IWineD3DSurface_PreLoad(This->lastActiveRenderTarget); - IWineD3DSurface_SetPBufferState(This->lastActiveRenderTarget, FALSE /* inPBuffer */, FALSE /* inTexture */); + ((IWineD3DSurfaceImpl *) This->lastActiveRenderTarget)->Flags &= ~SFLAG_INPBUFFER; + ((IWineD3DSurfaceImpl *) This->lastActiveRenderTarget)->Flags &= ~SFLAG_INTEXTURE; } This->lastActiveRenderTarget = target; if(oldRenderOffscreen != This->render_offscreen && This->depth_copy_state != WINED3D_DCS_NO_COPY) { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c4eefc97cee..772bdbb522b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2130,25 +2130,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { return WINED3D_OK; } -/* TODO: replace this function with context management routines */ -HRESULT WINAPI IWineD3DSurfaceImpl_SetPBufferState(IWineD3DSurface *iface, BOOL inPBuffer, BOOL inTexture) { - IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; - - if(inPBuffer) { - This->Flags |= SFLAG_INPBUFFER; - } else { - This->Flags &= ~SFLAG_INPBUFFER; - } - - if(inTexture) { - This->Flags |= SFLAG_INTEXTURE; - } else { - This->Flags &= ~SFLAG_INTEXTURE; - } - - return WINED3D_OK; -} - static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DSurface *override, DWORD Flags) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DDevice *D3D = (IWineD3DDevice *) This->resource.wineD3DDevice; @@ -3261,7 +3242,6 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = IWineD3DSurfaceImpl_LoadTexture, IWineD3DSurfaceImpl_SaveSnapshot, IWineD3DSurfaceImpl_SetContainer, - IWineD3DSurfaceImpl_SetPBufferState, IWineD3DSurfaceImpl_SetGlTextureDesc, IWineD3DSurfaceImpl_GetGlDesc, IWineD3DSurfaceImpl_GetData, diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 87ee0d05220..508aaae0d32 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1605,7 +1605,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineGDISurfaceImpl_LoadTexture, IWineGDISurfaceImpl_SaveSnapshot, IWineD3DSurfaceImpl_SetContainer, - IWineD3DSurfaceImpl_SetPBufferState, IWineD3DSurfaceImpl_SetGlTextureDesc, IWineD3DSurfaceImpl_GetGlDesc, IWineD3DSurfaceImpl_GetData, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7a8c4b82eb5..ddb487ed049 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1082,7 +1082,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Fla HRESULT WINAPI IWineD3DSurfaceImpl_CleanDirtyRect(IWineD3DSurface *iface); extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3DBase *container); -HRESULT WINAPI IWineD3DSurfaceImpl_SetPBufferState(IWineD3DSurface *iface, BOOL inPBuffer, BOOL inTexture); void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT textureName, int target); void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 3783ebcda8f..dfa5125db24 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -1113,7 +1113,6 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource) STDMETHOD(LoadTexture)(THIS) PURE; STDMETHOD(SaveSnapshot)(THIS_ const char *filename) PURE; STDMETHOD(SetContainer)(THIS_ IWineD3DBase *container) PURE; - STDMETHOD(SetPBufferState)(THIS_ BOOL inPBuffer, BOOL inTexture) PURE; STDMETHOD_(void,SetGlTextureDesc)(THIS_ UINT textureName, int target) PURE; STDMETHOD_(void,GetGlDesc)(THIS_ glDescriptor **glDescription) PURE; STDMETHOD_(CONST void *, GetData)(THIS) PURE; @@ -1168,7 +1167,6 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource) #define IWineD3DSurface_LoadTexture(p) (p)->lpVtbl->LoadTexture(p) #define IWineD3DSurface_SaveSnapshot(p,a) (p)->lpVtbl->SaveSnapshot(p,a) #define IWineD3DSurface_SetContainer(p,a) (p)->lpVtbl->SetContainer(p,a) -#define IWineD3DSurface_SetPBufferState(p,a,b) (p)->lpVtbl->SetPBufferState(p,a,b) #define IWineD3DSurface_SetGlTextureDesc(p,a,b) (p)->lpVtbl->SetGlTextureDesc(p,a,b) #define IWineD3DSurface_GetGlDesc(p,a) (p)->lpVtbl->GetGlDesc(p,a) #define IWineD3DSurface_GetData(p) (p)->lpVtbl->GetData(p)