Alexandre Julliard : winex11: The source offset for mirrored Xrender blits must be scaled too.

Alexandre Julliard julliard at winehq.org
Thu Apr 15 11:37:36 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr 15 12:04:18 2010 +0200

winex11: The source offset for mirrored Xrender blits must be scaled too.

---

 dlls/winex11.drv/xrender.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index ea6d0a7..68a3d7c 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -1884,8 +1884,8 @@ static void xrender_blit(Picture src_pict, Picture mask_pict, Picture dst_pict,
      * xscale/yscale contain the scaling factors for the width and height. In case of mirroring
      * we also need a x- and y-offset because without the pixels will be in the wrong quadrant of the x-y plane.
      */
-    int x_offset = (xscale<0) ? width : 0;
-    int y_offset = (yscale<0) ? height : 0;
+    int x_offset = (xscale<0) ? -width : 0;
+    int y_offset = (yscale<0) ? -height : 0;
 
     /* When we are using a mask, 'src_pict' contains a 1x1 picture for tiling, the actual source data is in mask_pict.
      * The 'src_pict' data effectively acts as an alpha channel to the tile data. We need PictOpOver for correct rendering. */
@@ -1897,11 +1897,17 @@ static void xrender_blit(Picture src_pict, Picture mask_pict, Picture dst_pict,
     if(xscale != 1.0 || yscale != 1.0)
     {
         if(mask_pict)
-            set_xrender_transformation(mask_pict, xscale, yscale, x_src + x_offset, y_src + y_offset);
+        {
+            set_xrender_transformation(mask_pict, xscale, yscale, x_src, y_src);
+            pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict,
+                              0, 0, x_offset, y_offset, 0, 0, width, height);
+        }
         else
-            set_xrender_transformation(src_pict, xscale, yscale, x_src + x_offset, y_src + y_offset);
-
-        pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, 0, 0, 0, 0, 0, 0, width, height);
+        {
+            set_xrender_transformation(src_pict, xscale, yscale, x_src, y_src);
+            pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict,
+                              x_offset, y_offset, 0, 0, 0, 0, width, height);
+        }
     }
     else
     {




More information about the wine-cvs mailing list