Module: wine
Branch: master
Commit: 8c3b0aead55654a4b349ca0fc263907252e32bbb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c3b0aead55654a4b349ca0fc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Thu Apr 7 19:37:59 2016 +0200
wined3d: Use the texture dimension helpers in surface_blt_special().
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/wined3d/surface.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3e45599..5fd238e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2662,6 +2662,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
if ((src_swapchain || src_surface == rt) && !dst_swapchain)
{
+ unsigned int src_width, src_height;
/* Blit from render target to texture */
BOOL stretchx;
@@ -2695,8 +2696,10 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
* back buffer. This is slower than reading line per line, thus not used for flipping
* -> If the app wants a scaled image with a dest rect that is bigger than the fb, it has to be copied
* pixel by pixel. */
- if (!stretchx || dst_rect->right - dst_rect->left > src_surface->resource.width
- || dst_rect->bottom - dst_rect->top > src_surface->resource.height)
+ src_width = wined3d_texture_get_level_width(src_texture, src_surface->texture_level);
+ src_height = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
+ if (!stretchx || dst_rect->right - dst_rect->left > src_width
+ || dst_rect->bottom - dst_rect->top > src_height)
{
TRACE("No stretching in x direction, using direct framebuffer -> texture copy.\n");
fb_copy_to_texture_direct(dst_surface, src_surface, src_rect, dst_rect, filter);