diff options
author | Frank Huang <frankr.huang@amd.com> | 2010-08-12 15:49:53 +0800 |
---|---|---|
committer | Martin-Éric Racine <q-funk@iki.fi> | 2010-08-12 19:59:59 +0300 |
commit | 673d71b970a6d02449c9994e67f337d117d7f075 (patch) | |
tree | 5d6936734e2fdc37c2456bae8795e66490f1892e /src/lx_exa.c | |
parent | 2d1a07327ef352b5f36cbd93a280485cafeeb4d4 (diff) |
Fix the PictOpOutReverse op
*Correct the entry for PictOutReverse
*Outside the source picture, the pixels should be all zero when doing
the PictOpOutReverse rendering with Dst
*Rename the function name of pict_a8 to add_a8
*Rename the function name of opover to two_pass
*Fix the bug in KDE dolphin file browser
Signed-off-by: Frank Huang <frankr.huang@amd.com>
Diffstat (limited to 'src/lx_exa.c')
-rw-r--r-- | src/lx_exa.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/lx_exa.c b/src/lx_exa.c index 20c7c04..c43417f 100644 --- a/src/lx_exa.c +++ b/src/lx_exa.c @@ -430,8 +430,8 @@ struct blend_ops_t }, /* PictOpOutReverse */ { - CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_DEST}, { - }, + CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { + CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* SrcAtop */ { CIMGP_ALPHA_TIMES_A, CIMGP_CHANNEL_B_ALPHA, CIMGP_CHANNEL_A_DEST}, { @@ -685,9 +685,11 @@ lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk, /* Get the source color */ /* If the op is PictOpOver, we should get the ARGB32 source format */ - if (op == PictOpOver && (srcFmt->alphabits != 0)) + if ((op == PictOpOver || op == PictOpOutReverse) && + (srcFmt->alphabits != 0)) exaScratch.srcColor = exaGetPixmapFirstPixel(pxSrc); - else if (op == PictOpOver && (srcFmt->alphabits == 0)) + else if ((op == PictOpOver || op == PictOpOutReverse) && + (srcFmt->alphabits == 0)) exaScratch.srcColor = lx_get_source_color(pxSrc, pSrc->format, PICT_a8r8g8b8); else { @@ -804,7 +806,7 @@ get_op_type(struct exa_format_t *src, struct exa_format_t *dst, int type) ((_x) * exaScratch.srcBpp)) static void -lx_composite_onepass_pict_a8(PixmapPtr pxDst, unsigned long dstOffset, +lx_composite_onepass_add_a8(PixmapPtr pxDst, unsigned long dstOffset, unsigned long srcOffset, int width, int height, int opX, int opY, int srcX, int srcY) { @@ -1083,7 +1085,7 @@ lx_do_composite_mask(PixmapPtr pxDst, unsigned long dstOffset, } static void -lx_do_composite_mask_opover(PixmapPtr pxDst, unsigned long dstOffset, +lx_do_composite_mask_two_pass(PixmapPtr pxDst, unsigned long dstOffset, unsigned int maskOffset, int width, int height, int opX, int opY, xPointFixed srcPoint) { @@ -1341,16 +1343,18 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, if (direction == 1) { dstOffset = GetPixmapOffset(exaScratch.srcPixmap, opX, opY); - if (exaScratch.op == PictOpOver) - lx_do_composite_mask_opover(exaScratch.srcPixmap, + if (exaScratch.op == PictOpOver || exaScratch.op == + PictOpOutReverse) + lx_do_composite_mask_two_pass(exaScratch.srcPixmap, dstOffset, srcOffset, opWidth, opHeight, opX, opY, srcPoint); else lx_do_composite_mask(exaScratch.srcPixmap, dstOffset, srcOffset, opWidth, opHeight); } else { - if (exaScratch.op == PictOpOver) - lx_do_composite_mask_opover(pxDst, dstOffset, + if (exaScratch.op == PictOpOver || exaScratch.op == + PictOpOutReverse) + lx_do_composite_mask_two_pass(pxDst, dstOffset, srcOffset, opWidth, opHeight, opX, opY, srcPoint); else lx_do_composite_mask(pxDst, dstOffset, srcOffset, @@ -1367,7 +1371,7 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, return ; } else if ((exaScratch.op == PictOpAdd) && (exaScratch.srcFormat->exa == PICT_a8) && (exaScratch.dstFormat->exa == PICT_a8)) - lx_composite_onepass_pict_a8(pxDst, dstOffset, srcOffset, + lx_composite_onepass_add_a8(pxDst, dstOffset, srcOffset, opWidth, opHeight, opX, opY, srcX, srcY); else lx_composite_onepass(pxDst, dstOffset, srcOffset, opWidth, @@ -1413,6 +1417,9 @@ lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, exaScratch.type = COMP_TYPE_ONEPASS; } else if (exaScratch.op == PictOpOver) break; + /* Outside the source is all zero vectors */ + else if (exaScratch.op == PictOpOutReverse) + exaScratch.srcColor = 0x0; } } else { if (exaScratch.type == COMP_TYPE_ONEPASS) { |