winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
7 participants
787 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Clean up IWineD3DSurface:: ReleaseDC.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 515ee4e89bb654d3668957135437f9cef0e8847b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=515ee4e89bb654d3668957135…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 17 12:53:34 2007 +0200 wined3d: Clean up IWineD3DSurface::ReleaseDC. --- dlls/wined3d/surface_gdi.c | 23 ++++++++++++++++++++++- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 49f24c9..f5c5b48 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1490,6 +1490,27 @@ const char* filename) return WINED3D_OK; } +HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + + TRACE("(%p)->(%p)\n",This,hDC); + + if (!(This->Flags & SFLAG_DCINUSE)) + return WINED3DERR_INVALIDCALL; + + if (This->hDC !=hDC) { + WARN("Application tries to release an invalid DC(%p), surface dc is %p\n", hDC, This->hDC); + return WINED3DERR_INVALIDCALL; + } + + /* we locked first, so unlock now */ + IWineD3DSurface_UnlockRect(iface); + + This->Flags &= ~SFLAG_DCINUSE; + + return WINED3D_OK; +} + /***************************************************************************** * IWineD3DSurface::PrivateSetup, GDI version * @@ -1641,7 +1662,7 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineGDISurfaceImpl_LockRect, IWineGDISurfaceImpl_UnlockRect, IWineD3DSurfaceImpl_GetDC, - IWineD3DSurfaceImpl_ReleaseDC, + IWineGDISurfaceImpl_ReleaseDC, IWineGDISurfaceImpl_Flip, IWineGDISurfaceImpl_Blt, IWineD3DBaseSurfaceImpl_GetBltStatus, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4452274..66d8b42 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1174,7 +1174,6 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); -HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC); HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); HRESULT WINAPI IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans);
1
0
0
0
Stefan Dösinger : wined3d: Clean up SetMem.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 511f9dfb2d5b15f2c182becd9a9870abb53d30a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=511f9dfb2d5b15f2c182becd9…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 17 15:16:37 2007 +0200 wined3d: Clean up SetMem. --- dlls/wined3d/surface.c | 6 ----- dlls/wined3d/surface_gdi.c | 49 +++++++++++++++++++++++++++++++++++++++- dlls/wined3d/wined3d_private.h | 2 - 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 676aed6..05303d3 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2540,12 +2540,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; - /* Render targets depend on their hdc, and we can't create an hdc on a user pointer */ - if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) { - ERR("Not supported on render targets\n"); - return WINED3DERR_INVALIDCALL; - } - if(This->Flags & (SFLAG_LOCKED | SFLAG_DCINUSE)) { WARN("Surface is locked or the HDC is in use\n"); return WINED3DERR_INVALIDCALL; diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 6521477..49f24c9 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1569,6 +1569,53 @@ HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RE return WINED3D_OK; } +HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; + + /* Render targets depend on their hdc, and we can't create an hdc on a user pointer */ + if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) { + ERR("Not supported on render targets\n"); + return WINED3DERR_INVALIDCALL; + } + + if(This->Flags & (SFLAG_LOCKED | SFLAG_DCINUSE)) { + WARN("Surface is locked or the HDC is in use\n"); + return WINED3DERR_INVALIDCALL; + } + + if(Mem && Mem != This->resource.allocatedMemory) { + void *release = NULL; + + /* Do I have to copy the old surface content? */ + if(This->Flags & SFLAG_DIBSECTION) { + /* Release the DC. No need to hold the critical section for the update + * Thread because this thread runs only on front buffers, but this method + * fails for render targets in the check above. + */ + SelectObject(This->hDC, This->dib.holdbitmap); + DeleteDC(This->hDC); + /* Release the DIB section */ + DeleteObject(This->dib.DIBsection); + This->dib.bitmap_data = NULL; + This->resource.allocatedMemory = NULL; + This->hDC = NULL; + This->Flags &= ~SFLAG_DIBSECTION; + } else if(!(This->Flags & SFLAG_USERPTR)) { + release = This->resource.allocatedMemory; + } + This->resource.allocatedMemory = Mem; + This->Flags |= SFLAG_USERPTR | SFLAG_INSYSMEM; + + /* Now free the old memory if any */ + HeapFree(GetProcessHeap(), 0, release); + } else if(This->Flags & SFLAG_USERPTR) { + /* Lockrect and GetDC will re-create the dib section and allocated memory */ + This->resource.allocatedMemory = NULL; + This->Flags &= ~SFLAG_USERPTR; + } + return WINED3D_OK; +} + /* FIXME: This vtable should not use any IWineD3DSurface* implementation functions, * only IWineD3DBaseSurface and IWineGDISurface ones. */ @@ -1607,7 +1654,7 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineD3DBaseSurfaceImpl_RealizePalette, IWineD3DBaseSurfaceImpl_SetColorKey, IWineD3DBaseSurfaceImpl_GetPitch, - IWineD3DSurfaceImpl_SetMem, + IWineGDISurfaceImpl_SetMem, IWineD3DBaseSurfaceImpl_SetOverlayPosition, IWineD3DBaseSurfaceImpl_GetOverlayPosition, IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2b1db31..4452274 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1171,12 +1171,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); -void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC); -HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem); HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); HRESULT WINAPI IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans);
1
0
0
0
Stefan Dösinger : wined3d: Clean up AddDirtyRect.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 24564915b712653e5729e6e4a350bb0151671170 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=24564915b712653e5729e6e4a…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Sep 17 15:07:13 2007 +0200 wined3d: Clean up AddDirtyRect. --- dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/surface_gdi.c | 10 +++++++++- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 1 - 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index d91ee6c..28677c6 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -148,7 +148,7 @@ static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) { for (i = 0; i < This->baseTexture.levels; i++) { for (j = WINED3DCUBEMAP_FACE_POSITIVE_X; j <= WINED3DCUBEMAP_FACE_NEGATIVE_Z ; j++) { - IWineD3DSurfaceImpl_AddDirtyRect(This->surfaces[j][i], NULL); + IWineD3DSurface_AddDirtyRect(This->surfaces[j][i], NULL); IWineD3DSurface_SetGlTextureDesc(This->surfaces[j][i], This->baseTexture.textureName, cube_targets[j]); IWineD3DSurface_LoadTexture(This->surfaces[j][i], srgb_mode); } diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index f4c9248..6521477 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1561,6 +1561,14 @@ void WINAPI IWineGDISurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor * *glDescription = NULL; } +HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect) { + /* GDI surface data can only be in one location, the system memory dib section. So they are + * always clean by definition. + */ + TRACE("No dirtification in GDI surfaces\n"); + return WINED3D_OK; +} + /* FIXME: This vtable should not use any IWineD3DSurface* implementation functions, * only IWineD3DBaseSurface and IWineGDISurface ones. */ @@ -1607,7 +1615,7 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineD3DBaseSurfaceImpl_SetClipper, IWineD3DBaseSurfaceImpl_GetClipper, /* Internal use: */ - IWineD3DSurfaceImpl_AddDirtyRect, + IWineGDISurfaceImpl_AddDirtyRect, IWineGDISurfaceImpl_LoadTexture, IWineGDISurfaceImpl_SaveSnapshot, IWineD3DBaseSurfaceImpl_SetContainer, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 48f8c8c..1dcaee1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -132,7 +132,7 @@ static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) { FIXME("Texture (%p) has been reloaded at least 20 times due to WINED3DSAMP_SRGBTEXTURE changes on it\'s sampler\n", This); for (i = 0; i < This->baseTexture.levels; i++) { - IWineD3DSurfaceImpl_AddDirtyRect(This->surfaces[i], NULL); + IWineD3DSurface_AddDirtyRect(This->surfaces[i], NULL); IWineD3DSurface_SetGlTextureDesc(This->surfaces[i], This->baseTexture.textureName, IWineD3DTexture_GetTextureDimensions(iface)); IWineD3DSurface_LoadTexture(This->surfaces[i], srgb_mode); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8e5719a..2b1db31 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1173,7 +1173,6 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3D ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); -extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC);
1
0
0
0
Stefan Dösinger : wined3d: Clean up SetFormatDesc.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: e56c6610c6d4bd5864459ec282f4401a19b3b45d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e56c6610c6d4bd5864459ec28…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 16:49:02 2007 +0200 wined3d: Clean up SetFormatDesc. --- dlls/wined3d/surface.c | 53 ++++++++++------------------------------ dlls/wined3d/surface_base.c | 40 ++++++++++++++++++++++++++++++ dlls/wined3d/surface_gdi.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 55 insertions(+), 42 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f37125e..676aed6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2518,50 +2518,23 @@ extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, C HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + HRESULT hr; const GlPixelFormatDesc *glDesc; - const StaticPixelFormatDesc *formatEntry = getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc); - - if (This->resource.format != WINED3DFMT_UNKNOWN) { - FIXME("(%p) : The format of the surface must be WINED3DFORMAT_UNKNOWN\n", This); - return WINED3DERR_INVALIDCALL; - } + getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc); - TRACE("(%p) : Setting texture format to (%d,%s)\n", This, format, debug_d3dformat(format)); - if (format == WINED3DFMT_UNKNOWN) { - This->resource.size = 0; - } else if (format == WINED3DFMT_DXT1) { - /* DXT1 is half byte per pixel */ - This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)) >> 1; + TRACE("(%p) : Calling base function first\n", This); + hr = IWineD3DBaseSurfaceImpl_SetFormat(iface, format); + if(SUCCEEDED(hr)) { + /* Setup some glformat defaults */ + This->glDescription.glFormat = glDesc->glFormat; + This->glDescription.glFormatInternal = glDesc->glInternal; + This->glDescription.glType = glDesc->glType; - } else if (format == WINED3DFMT_DXT2 || format == WINED3DFMT_DXT3 || - format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) { - This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)); - } else { - unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; - This->resource.size = ((This->pow2Width * formatEntry->bpp) + alignment - 1) & ~(alignment - 1); - This->resource.size *= This->pow2Height; + This->Flags &= ~SFLAG_ALLOCATED; + TRACE("(%p) : glFormat %d, glFotmatInternal %d, glType %d\n", This, + This->glDescription.glFormat, This->glDescription.glFormatInternal, This->glDescription.glType); } - - - /* Setup some glformat defaults */ - This->glDescription.glFormat = glDesc->glFormat; - This->glDescription.glFormatInternal = glDesc->glInternal; - This->glDescription.glType = glDesc->glType; - - if (format != WINED3DFMT_UNKNOWN) { - This->bytesPerPixel = formatEntry->bpp; - } else { - This->bytesPerPixel = 0; - } - - This->Flags |= (WINED3DFMT_D16_LOCKABLE == format) ? SFLAG_LOCKABLE : 0; - This->Flags &= ~SFLAG_ALLOCATED; - - This->resource.format = format; - - TRACE("(%p) : Size %d, bytesPerPixel %d, glFormat %d, glFotmatInternal %d, glType %d\n", This, This->resource.size, This->bytesPerPixel, This->glDescription.glFormat, This->glDescription.glFormatInternal, This->glDescription.glType); - - return WINED3D_OK; + return hr; } HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index 5bd73c8..1cdb2d0 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -436,3 +436,43 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWin return WINED3D_OK; } + +HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) { + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + const StaticPixelFormatDesc *formatEntry = getFormatDescEntry(format, NULL, NULL); + + if (This->resource.format != WINED3DFMT_UNKNOWN) { + FIXME("(%p) : The format of the surface must be WINED3DFORMAT_UNKNOWN\n", This); + return WINED3DERR_INVALIDCALL; + } + + TRACE("(%p) : Setting texture format to (%d,%s)\n", This, format, debug_d3dformat(format)); + if (format == WINED3DFMT_UNKNOWN) { + This->resource.size = 0; + } else if (format == WINED3DFMT_DXT1) { + /* DXT1 is half byte per pixel */ + This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)) >> 1; + + } else if (format == WINED3DFMT_DXT2 || format == WINED3DFMT_DXT3 || + format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) { + This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)); + } else { + unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; + This->resource.size = ((This->pow2Width * formatEntry->bpp) + alignment - 1) & ~(alignment - 1); + This->resource.size *= This->pow2Height; + } + + if (format != WINED3DFMT_UNKNOWN) { + This->bytesPerPixel = formatEntry->bpp; + } else { + This->bytesPerPixel = 0; + } + + This->Flags |= (WINED3DFMT_D16_LOCKABLE == format) ? SFLAG_LOCKABLE : 0; + + This->resource.format = format; + + TRACE("(%p) : Size %d, bytesPerPixel %d\n", This, This->resource.size, This->bytesPerPixel); + + return WINED3D_OK; +} diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 1b74381..f4c9248 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1614,6 +1614,6 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineGDISurfaceImpl_SetGlTextureDesc, IWineGDISurfaceImpl_GetGlDesc, IWineD3DSurfaceImpl_GetData, - IWineD3DSurfaceImpl_SetFormat, + IWineD3DBaseSurfaceImpl_SetFormat, IWineGDISurfaceImpl_PrivateSetup }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 88fee9d..8e5719a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1168,13 +1168,13 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *ifac HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *SrcRect, IWineD3DSurface *DstSurface, RECT *DstRect, DWORD Flags, WINEDDOVERLAYFX *FX); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper); +HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); const void *WINAPI IWineD3DSurfaceImpl_GetData(IWineD3DSurface *iface); -HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC); HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem);
1
0
0
0
Stefan Dösinger : wined3d: Clean up SetGLTextureDesc and GetGLDesc.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 2600041703ca0241d5ae067450c42c9e8ddd8ffd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2600041703ca0241d5ae06745…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 16:40:28 2007 +0200 wined3d: Clean up SetGLTextureDesc and GetGLDesc. --- dlls/wined3d/surface_gdi.c | 15 +++++++++++++-- dlls/wined3d/wined3d_private.h | 2 -- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index f74e457..1b74381 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1550,6 +1550,17 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface) return WINED3D_OK; } +void WINAPI IWineGDISurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT textureName, int target) { + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + FIXME("(%p) : Should not be called on a GDI surface. textureName %u, target %i\n", This, textureName, target); +} + +void WINAPI IWineGDISurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription) { + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + FIXME("(%p) : Should not be called on a GDI surface\n", This); + *glDescription = NULL; +} + /* FIXME: This vtable should not use any IWineD3DSurface* implementation functions, * only IWineD3DBaseSurface and IWineGDISurface ones. */ @@ -1600,8 +1611,8 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = IWineGDISurfaceImpl_LoadTexture, IWineGDISurfaceImpl_SaveSnapshot, IWineD3DBaseSurfaceImpl_SetContainer, - IWineD3DSurfaceImpl_SetGlTextureDesc, - IWineD3DSurfaceImpl_GetGlDesc, + IWineGDISurfaceImpl_SetGlTextureDesc, + IWineGDISurfaceImpl_GetGlDesc, IWineD3DSurfaceImpl_GetData, IWineD3DSurfaceImpl_SetFormat, IWineGDISurfaceImpl_PrivateSetup diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index eac12b6..88fee9d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1173,8 +1173,6 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); -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); HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC);
1
0
0
0
Stefan Dösinger : wined3d: Reorder surface impl predeclarations.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 9aa56626476fad2b0e4f29848d463436a13193d6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9aa56626476fad2b0e4f29848…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 16:33:23 2007 +0200 wined3d: Reorder surface impl predeclarations. --- dlls/wined3d/wined3d_private.h | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7329ebc..eac12b6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1142,7 +1142,6 @@ extern const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl; /* Predeclare the shared Surface functions */ HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj); ULONG WINAPI IWineD3DBaseSurfaceImpl_AddRef(IWineD3DSurface *iface); -ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDevice(IWineD3DSurface *iface, IWineD3DDevice** ppDevice); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPrivateData(IWineD3DSurface *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags); @@ -1150,7 +1149,6 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPrivateData(IWineD3DSurface *iface, RE HRESULT WINAPI IWineD3DBaseSurfaceImpl_FreePrivateData(IWineD3DSurface *iface, REFGUID refguid); DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD PriorityNew); DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface); -void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetContainer(IWineD3DSurface* iface, REFIID riid, void** ppContainer); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFACE_DESC *pDesc); @@ -1158,25 +1156,12 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWOR HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD Flags); HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface); -HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, WINEDDCOLORKEY *CKey); -HRESULT WINAPI IWineD3DSurfaceImpl_CleanDirtyRect(IWineD3DSurface *iface); -extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3DBase *container); -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); -HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); -HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); -HRESULT WINAPI IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans); -HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal); -HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); -HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC); DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DBaseSurfaceImpl_RealizePalette(IWineD3DSurface *iface); -HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem); HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LONG X, LONG Y); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LONG *X, LONG *Y); HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, DWORD Flags, IWineD3DSurface *Ref); @@ -1184,6 +1169,21 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, REC HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper); HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper); +ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); +void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface); +HRESULT WINAPI IWineD3DSurfaceImpl_SetPixelFormat(IWineD3DSurface *iface, WINED3DFORMAT Format, BYTE *Surface, DWORD Size); +extern HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect); +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); +HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format); +HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC); +HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC); +HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem); + +HRESULT WINAPI IWineGDISurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, WINEDDBLTFX *DDBltFx, WINED3DTEXTUREFILTERTYPE Filter); +HRESULT WINAPI IWineGDISurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty, IWineD3DSurface *Source, RECT *rsrc, DWORD trans); + /* Surface flags: */ #define SFLAG_OVERSIZE 0x00000001 /* Surface is bigger than gl size, blts only */ #define SFLAG_CONVERTED 0x00000002 /* Converted for color keying or Palettized */
1
0
0
0
Stefan Dösinger : wined3d: Base surface move, part 2.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: e2944175e5b147160db51d891b7b2a25f4ed16e2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2944175e5b147160db51d891…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 16:27:58 2007 +0200 wined3d: Base surface move, part 2. --- dlls/wined3d/surface.c | 271 ++-------------------------------------- dlls/wined3d/surface_base.c | 247 ++++++++++++++++++++++++++++++++++++ dlls/wined3d/surface_gdi.c | 27 +++-- dlls/wined3d/wined3d_private.h | 24 ++-- 4 files changed, 286 insertions(+), 283 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e2944175e5b147160db51…
1
0
0
0
Stefan Dösinger : wined3d: Move non-rendering surface specific code to the base class.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: d99143c2519ed379dec9d535ae55926cd861f03f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d99143c2519ed379dec9d535a…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 14:03:39 2007 +0200 wined3d: Move non-rendering surface specific code to the base class. --- dlls/wined3d/surface.c | 99 ++------------------------------------- dlls/wined3d/surface_base.c | 93 +++++++++++++++++++++++++++++++++++++- dlls/wined3d/surface_gdi.c | 12 ++-- dlls/wined3d/wined3d_private.h | 12 ++-- 4 files changed, 110 insertions(+), 106 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d99143c2519ed379dec9d…
1
0
0
0
Stefan Dösinger : wined3d: Move resource methods to the base surface class.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 0c91610433b6d4853bf553564bc9a346264c3f16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0c91610433b6d4853bf553564…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 13:42:18 2007 +0200 wined3d: Move resource methods to the base surface class. --- dlls/wined3d/surface.c | 58 ++++++--------------------------------- dlls/wined3d/surface_base.c | 44 ++++++++++++++++++++++++++++++ dlls/wined3d/surface_gdi.c | 18 ++++++------ dlls/wined3d/wined3d_private.h | 18 ++++++------ 4 files changed, 71 insertions(+), 67 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0c91610433b6d4853bf55…
1
0
0
0
Stefan Dösinger : wined3d: Start of some surface cleanup.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 8434060b7ec2e32758f43935196f6182d881575e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8434060b7ec2e32758f439351…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Sep 16 13:29:44 2007 +0200 wined3d: Start of some surface cleanup. This patch and the following intend to make the surface code more manageable and are a preparation to add gl3 support. The code adds a new IWineD3DBaseSurface surface type, which will contain the non-rendering management code. IWineD3DSurface and IWineGDISurface will be derived from IWineD3DBaseSurface, and IWineGL3Surface can be added later. --- dlls/wined3d/Makefile.in | 1 + dlls/wined3d/surface.c | 23 +--------------- dlls/wined3d/surface_base.c | 56 ++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/surface_gdi.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 60 insertions(+), 24 deletions(-) diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in index 16587b3..9ec6494 100644 --- a/dlls/wined3d/Makefile.in +++ b/dlls/wined3d/Makefile.in @@ -25,6 +25,7 @@ C_SRCS = \ resource.c \ state.c \ stateblock.c \ + surface_base.c \ surface.c \ surface_gdi.c \ swapchain.c \ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 7bad3d7..f3a2142 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -334,27 +334,6 @@ GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchai return GL_BACK; } -/* ******************************************* - IWineD3DSurface IUnknown parts follow - ******************************************* */ -HRESULT WINAPI IWineD3DSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj) -{ - IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; - /* Warn ,but be nice about things */ - TRACE("(%p)->(%s,%p)\n", This,debugstr_guid(riid),ppobj); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IWineD3DBase) - || IsEqualGUID(riid, &IID_IWineD3DResource) - || IsEqualGUID(riid, &IID_IWineD3DSurface)) { - IUnknown_AddRef((IUnknown*)iface); - *ppobj = This; - return S_OK; - } - *ppobj = NULL; - return E_NOINTERFACE; -} - ULONG WINAPI IWineD3DSurfaceImpl_AddRef(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; ULONG ref = InterlockedIncrement(&This->resource.ref); @@ -4030,7 +4009,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DCl const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = { /* IUnknown */ - IWineD3DSurfaceImpl_QueryInterface, + IWineD3DBaseSurfaceImpl_QueryInterface, IWineD3DSurfaceImpl_AddRef, IWineD3DSurfaceImpl_Release, /* IWineD3DResource */ diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c new file mode 100644 index 0000000..48cad48 --- /dev/null +++ b/dlls/wined3d/surface_base.c @@ -0,0 +1,56 @@ +/* + * IWineD3DSurface Implementation of management(non-rendering) functions + * + * Copyright 1998 Lionel Ulmer + * Copyright 2000-2001 TransGaming Technologies Inc. + * Copyright 2002-2005 Jason Edmeades + * Copyright 2002-2003 Raphael Junqueira + * Copyright 2004 Christian Costa + * Copyright 2005 Oliver Stieber + * Copyright 2006 Stefan D�singer for CodeWeavers + * Copyright 2007 Henri Verbeet + * Copyright 2006-2007 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" +#include "wined3d_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); + +/* Do NOT define GLINFO_LOCATION in this file. THIS CODE MUST NOT USE IT */ + +/* ******************************************* + IWineD3DSurface IUnknown parts follow + ******************************************* */ +HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj) +{ + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + /* Warn ,but be nice about things */ + TRACE("(%p)->(%s,%p)\n", This,debugstr_guid(riid),ppobj); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IWineD3DBase) + || IsEqualGUID(riid, &IID_IWineD3DResource) + || IsEqualGUID(riid, &IID_IWineD3DSurface)) { + IUnknown_AddRef((IUnknown*)iface); + *ppobj = This; + return S_OK; + } + *ppobj = NULL; + return E_NOINTERFACE; +} diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 9f49882..3ba49f1 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -1553,7 +1553,7 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface) const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl = { /* IUnknown */ - IWineD3DSurfaceImpl_QueryInterface, + IWineD3DBaseSurfaceImpl_QueryInterface, IWineD3DSurfaceImpl_AddRef, IWineD3DSurfaceImpl_Release, /* IWineD3DResource */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 86b11de..c69bf40 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1140,7 +1140,7 @@ extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl; extern const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl; /* Predeclare the shared Surface functions */ -HRESULT WINAPI IWineD3DSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj); +HRESULT WINAPI IWineD3DBaseSurfaceImpl_QueryInterface(IWineD3DSurface *iface, REFIID riid, LPVOID *ppobj); ULONG WINAPI IWineD3DSurfaceImpl_AddRef(IWineD3DSurface *iface); ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface); HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent);
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
79
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Results per page:
10
25
50
100
200