[PATCH 2/5] wined3d: Properly handle back-buffers in surface_translate_drawable_coords().

Henri Verbeet hverbeet at codeweavers.com
Wed Mar 22 17:11:26 CDT 2017


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/surface.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 94ec035..2a3fbc9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2078,13 +2078,16 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
     struct wined3d_texture *texture = surface->container;
     UINT drawable_height;
 
-    if (texture->swapchain && texture == texture->swapchain->front_buffer)
+    if (texture->swapchain)
     {
         POINT offset = {0, 0};
         RECT windowsize;
 
-        ScreenToClient(window, &offset);
-        OffsetRect(rect, offset.x, offset.y);
+        if (texture == texture->swapchain->front_buffer)
+        {
+            ScreenToClient(window, &offset);
+            OffsetRect(rect, offset.x, offset.y);
+        }
 
         GetClientRect(window, &windowsize);
         drawable_height = windowsize.bottom - windowsize.top;
-- 
2.1.4




More information about the wine-patches mailing list