wined3d: Properly handle back-buffers in surface_translate_drawable_coords().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Henri Verbeet 2017-03-22 23:11:26 +01:00 committed by Alexandre Julliard
parent 067f323844
commit bedb40e5af
1 changed files with 6 additions and 3 deletions

View File

@ -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;