Alexander Dorofeyev : wined3d: Improve thread safety in IWineD3DSurfaceImpl_BltOverride.

Alexandre Julliard julliard at winehq.org
Mon Dec 10 08:54:28 CST 2007


Module: wine
Branch: master
Commit: 1dbc9d50c9737081196dec6829414229c88aa69f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1dbc9d50c9737081196dec6829414229c88aa69f

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Mon Dec 10 03:39:51 2007 -0800

wined3d: Improve thread safety in IWineD3DSurfaceImpl_BltOverride.

---

 dlls/wined3d/surface.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b8a97d5..692b506 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3236,6 +3236,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
                 return WINED3DERR_INVALIDCALL;
             }
 
+            ActivateContext(myDevice, (IWineD3DSurface *) This, CTXUSAGE_RESOURCELOAD);
+            ENTER_GL();
+
             TRACE("Calling GetSwapChain with mydevice = %p\n", myDevice);
             if(dstSwapchain && dstSwapchain->backBuffer && This == (IWineD3DSurfaceImpl*) dstSwapchain->backBuffer[0]) {
                 glDrawBuffer(GL_BACK);
@@ -3247,6 +3250,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
                 glDrawBuffer(myDevice->offscreenBuffer);
                 checkGLcall("glDrawBuffer(myDevice->offscreenBuffer3)");
             } else {
+                LEAVE_GL();
                 TRACE("Surface is higher back buffer, falling back to software\n");
                 return WINED3DERR_INVALIDCALL;
             }
@@ -3268,6 +3272,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
                 glDrawBuffer(GL_BACK);
             }
             vcheckGLcall("glDrawBuffer");
+            LEAVE_GL();
 
             return WINED3D_OK;
         }




More information about the wine-cvs mailing list