Commit 35fdf096 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 81dae1c6
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment