Henri Verbeet : wined3d: Remove the useless lastThread field from IWineD3DDeviceImpl.

Alexandre Julliard julliard at winehq.org
Tue Jul 21 09:34:44 CDT 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jul 21 11:51:12 2009 +0200

wined3d: Remove the useless lastThread field from IWineD3DDeviceImpl.

---

 dlls/wined3d/context.c         |    9 +++++----
 dlls/wined3d/device.c          |    1 -
 dlls/wined3d/wined3d_private.h |    1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index c625674..de428cd 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1551,7 +1551,8 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
         switch(wined3d_settings.offscreen_rendering_mode) {
             case ORM_FBO:
                 /* FBOs do not need a different context. Stay with whatever context is active at the moment */
-                if(This->activeContext && tid == This->lastThread) {
+                if (This->activeContext && This->activeContext->tid == tid)
+                {
                     context = This->activeContext;
                 } else {
                     /* This may happen if the app jumps straight into offscreen rendering
@@ -1600,7 +1601,8 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
 
             case ORM_BACKBUFFER:
                 /* Stay with the currently active context for back buffer rendering */
-                if(This->activeContext && tid == This->lastThread) {
+                if (This->activeContext && This->activeContext->tid == tid)
+                {
                     context = This->activeContext;
                 } else {
                     /* This may happen if the app jumps straight into offscreen rendering
@@ -1763,12 +1765,11 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
 
     if (!target) target = This->activeContext->current_rt;
 
-    if (This->activeContext->current_rt != target || tid != This->lastThread)
+    if (This->activeContext->current_rt != target || This->activeContext->tid != tid)
     {
         context = FindContext(This, target, tid);
         context->draw_buffer_dirty = TRUE;
         context->current_rt = target;
-        This->lastThread = tid;
     } else {
         /* Stick to the old context */
         context = This->activeContext;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 422dbf8..94000df 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2165,7 +2165,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
     }
     IWineD3DSurface_AddRef(This->render_targets[0]);
     This->activeContext = swapchain->context[0];
-    This->lastThread = GetCurrentThreadId();
 
     /* Depth Stencil support */
     This->stencilBufferTarget = This->auto_depth_stencil_buffer;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d8d95e7..b7085c5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1584,7 +1584,6 @@ struct IWineD3DDeviceImpl
     /* Context management */
     WineD3DContext          **contexts;                  /* Dynamic array containing pointers to context structures */
     WineD3DContext          *activeContext;
-    DWORD                   lastThread;
     UINT                    numContexts;
     WineD3DContext          *pbufferContext;             /* The context that has a pbuffer as drawable */
     DWORD                   pbufferWidth, pbufferHeight; /* Size of the buffer drawable */




More information about the wine-cvs mailing list