Henri Verbeet : wined3d: Only translate coordinates for swapchain surfaces in surface_translate_drawable_coords ().

Alexandre Julliard julliard at winehq.org
Mon May 22 15:54:03 CDT 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun May 21 17:53:40 2017 +0200

wined3d: Only translate coordinates for swapchain surfaces in surface_translate_drawable_coords().

This fixes a regression introduced by commit
dbd8c89ea8cd1d887e9999d203da3e79c4ffbd1a. When using ORM_BACKBUFFER,
off-screen surfaces may be loaded into WINED3D_LOCATION_DRAWABLE. They
shouldn't be flipped in that case.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 08bf156..abdeb9c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1911,27 +1911,22 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
 void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect)
 {
     struct wined3d_texture *texture = surface->container;
+    POINT offset = {0, 0};
     UINT drawable_height;
+    RECT windowsize;
 
-    if (texture->swapchain)
-    {
-        POINT offset = {0, 0};
-        RECT windowsize;
-
-        if (texture == texture->swapchain->front_buffer)
-        {
-            ScreenToClient(window, &offset);
-            OffsetRect(rect, offset.x, offset.y);
-        }
+    if (!texture->swapchain)
+        return;
 
-        GetClientRect(window, &windowsize);
-        drawable_height = windowsize.bottom - windowsize.top;
-    }
-    else
+    if (texture == texture->swapchain->front_buffer)
     {
-        drawable_height = wined3d_texture_get_level_height(texture, surface->texture_level);
+        ScreenToClient(window, &offset);
+        OffsetRect(rect, offset.x, offset.y);
     }
 
+    GetClientRect(window, &windowsize);
+    drawable_height = windowsize.bottom - windowsize.top;
+
     rect->top = drawable_height - rect->top;
     rect->bottom = drawable_height - rect->bottom;
 }




More information about the wine-cvs mailing list