Henri Verbeet : wined3d: Move some context selection code from ActivateContext() to FindContext().

Alexandre Julliard julliard at winehq.org
Wed Jul 22 09:35:32 CDT 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Jul 22 10:41:09 2009 +0200

wined3d: Move some context selection code from ActivateContext() to FindContext().

---

 dlls/wined3d/context.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 89d79a6..2c61268 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1608,6 +1608,13 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
     const struct GlPixelFormatDesc *old, *new;
     struct WineD3DContext *context;
 
+    if (!target) target = This->activeContext->current_rt;
+
+    if (This->activeContext->current_rt == target && This->activeContext->tid == tid)
+    {
+        return This->activeContext;
+    }
+
     if (SUCCEEDED(IWineD3DSurface_GetContainer(target, &IID_IWineD3DSwapChain, (void **)&swapchain))) {
         TRACE("Rendering onscreen\n");
 
@@ -1763,6 +1770,9 @@ retry:
         This->isInDraw = oldInDraw;
     }
 
+    context->draw_buffer_dirty = TRUE;
+    context->current_rt = target;
+
     return context;
 }
 
@@ -1834,17 +1844,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
 
     TRACE("(%p): Selecting context for render target %p, thread %d\n", This, target, tid);
 
-    if (!target) target = This->activeContext->current_rt;
-
-    if (This->activeContext->current_rt != target || This->activeContext->tid != tid)
-    {
-        context = FindContext(This, target, tid);
-        context->draw_buffer_dirty = TRUE;
-        context->current_rt = target;
-    } else {
-        /* Stick to the old context */
-        context = This->activeContext;
-    }
+    context = FindContext(This, target, tid);
 
     gl_info = context->gl_info;
 




More information about the wine-cvs mailing list