Henri Verbeet : wined3d: Use the texture dimension helpers in surface_translate_drawable_coords().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 8 11:18:23 CDT 2016


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Apr  7 19:37:58 2016 +0200

wined3d: Use the texture dimension helpers in surface_translate_drawable_coords().

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

---

 dlls/wined3d/surface.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 301aa16..3e45599 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2447,9 +2447,10 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, st
  * origin, while D3D has a top-left origin. */
 void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect)
 {
+    struct wined3d_texture *texture = surface->container;
     UINT drawable_height;
 
-    if (surface->container->swapchain && surface->container == surface->container->swapchain->front_buffer)
+    if (texture->swapchain && texture == texture->swapchain->front_buffer)
     {
         POINT offset = {0, 0};
         RECT windowsize;
@@ -2462,7 +2463,7 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW
     }
     else
     {
-        drawable_height = surface->resource.height;
+        drawable_height = wined3d_texture_get_level_height(texture, surface->texture_level);
     }
 
     rect->top = drawable_height - rect->top;




More information about the wine-cvs mailing list