Roderick Colenbrander : winex11: Use PictOpOver instead of PictOpSrc in 1-bit -> color blits.

Alexandre Julliard julliard at winehq.org
Wed Feb 17 10:12:05 CST 2010


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

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Wed Feb 17 12:43:46 2010 +0100

winex11: Use PictOpOver instead of PictOpSrc in 1-bit -> color blits.

---

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

diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index a5cd65a..d3600b7 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -1852,28 +1852,30 @@ static void xrender_blit(Picture src_pict, Picture mask_pict, Picture dst_pict,
     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. */
+    int op = mask_pict ? PictOpOver : PictOpSrc;
+
     /* When we need to scale we perform scaling and source_x / source_y translation using a transformation matrix.
      * This is needed because XRender is inaccurate in combination with scaled source coordinates passed to XRenderComposite.
      * In all other cases we do use XRenderComposite for translation as it is faster than using a transformation matrix. */
     if(xscale != 1.0 || yscale != 1.0)
     {
-        /* When we are using a mask, 'src_pict' contains a 1x1 picture for tiling, the actual source data is in mask_pict */
         if(mask_pict)
             set_xrender_transformation(mask_pict, xscale, yscale, x_offset, y_offset);
         else
             set_xrender_transformation(src_pict, xscale, yscale, x_src + x_offset, y_src + y_offset);
 
-        pXRenderComposite(gdi_display, PictOpSrc, src_pict, mask_pict, dst_pict, 0, 0, 0, 0, 0, 0, width, height);
+        pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, 0, 0, 0, 0, 0, 0, width, height);
     }
     else
     {
-        /* When we are using a mask, 'src_pict' contains a 1x1 picture for tiling, the actual source data is in mask_pict */
         if(mask_pict)
             set_xrender_transformation(mask_pict, 1, 1, 0, 0);
         else
             set_xrender_transformation(src_pict, 1, 1, 0, 0);
 
-        pXRenderComposite(gdi_display, PictOpSrc, src_pict, mask_pict, dst_pict, x_src, y_src, 0, 0, 0, 0, width, height);
+        pXRenderComposite(gdi_display, op, src_pict, mask_pict, dst_pict, x_src, y_src, 0, 0, 0, 0, width, height);
     }
 }
 




More information about the wine-cvs mailing list