[PATCH 5/5] wined3d: Translate front buffer coordinates in surface_blt_to_drawable().

Henri Verbeet hverbeet at codeweavers.com
Thu May 20 02:12:22 CDT 2010


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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 811ba11..9e1d434 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4350,6 +4350,24 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
         dst_rect = src_rect;
     }
 
+    if ((This->Flags & SFLAG_SWAPCHAIN) && This == ((IWineD3DSwapChainImpl *)This->container)->front_buffer)
+    {
+        RECT windowsize;
+        POINT offset = {0, 0};
+        UINT h;
+
+        ClientToScreen(context->win_handle, &offset);
+        GetClientRect(context->win_handle, &windowsize);
+        h = windowsize.bottom - windowsize.top;
+
+        dst_rect.left -= offset.x;
+        dst_rect.right -=offset.x;
+        dst_rect.top -= offset.y;
+        dst_rect.bottom -=offset.y;
+        dst_rect.top += This->currentDesc.Height - h;
+        dst_rect.bottom += This->currentDesc.Height - h;
+    }
+
     device->blitter->set_shader((IWineD3DDevice *) device, This);
 
     ENTER_GL();
-- 
1.6.4.4




More information about the wine-patches mailing list