Henri Verbeet : wined3d: Use surface_is_offscreen() in context_apply_draw_buffer().

Alexandre Julliard julliard at winehq.org
Tue Dec 15 09:40:16 CST 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Dec 14 20:49:56 2009 +0100

wined3d: Use surface_is_offscreen() in context_apply_draw_buffer().

---

 dlls/wined3d/context.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 0debd2e..62eb0ac 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2054,15 +2054,13 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
     IWineD3DSurface *rt = context->current_rt;
-    IWineD3DSwapChain *swapchain;
     IWineD3DDeviceImpl *device;
 
     device = ((IWineD3DSurfaceImpl *)rt)->resource.device;
-    if (SUCCEEDED(IWineD3DSurface_GetContainer(rt, &IID_IWineD3DSwapChain, (void **)&swapchain)))
+    if (!surface_is_offscreen(rt))
     {
-        IWineD3DSwapChain_Release((IUnknown *)swapchain);
         ENTER_GL();
-        glDrawBuffer(surface_get_gl_buffer(rt, swapchain));
+        glDrawBuffer(surface_get_gl_buffer(rt, (IWineD3DSwapChain *)((IWineD3DSurfaceImpl *)rt)->container));
         checkGLcall("glDrawBuffers()");
         LEAVE_GL();
     }




More information about the wine-cvs mailing list