From a19abd9fd57088395cfe2af7e395787645a181ef Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Wed, 17 Feb 2010 12:43:46 +0100 Subject: [PATCH] winex11: Use PictOpOver instead of PictOpSrc in 1-bit -> color blits. --- dlls/winex11.drv/xrender.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index a5cd65af5b3..d3600b7b29b 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); } } -- 2.11.4.GIT