From f130d99c94edbf5aeebeb317df64dbd7a6d20efd Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 23 Nov 2008 18:36:32 +0100 Subject: [PATCH] fix Multiply component-alpha version --- pixman/pixman-combine.c.template | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template index 80cf419..17e184c 100644 --- a/pixman/pixman-combine.c.template +++ b/pixman/pixman-combine.c.template @@ -392,26 +392,19 @@ fbCombineMultiplyC (pixman_implementation_t *imp, pixman_op_t op, comp4_t m = *(mask + i); comp4_t s = combineMask (src, mask, i); comp4_t d = *(dest + i); - comp4_t r = s; - comp4_t src_ia = Alpha (~s); + comp4_t r = d; comp4_t dest_ia = Alpha (~d); if (m == 0) continue; - if (m == ~0) + fbCombineMaskValueC (&s, &m); + + m = ~m; + if (m != 0) { - FbByteAddMul (r, dest_ia, d, src_ia); - fbCombineMaskC (&s, &m); - FbByteMul (s, dest_ia); - fbCombineMaskValueC (&r, &m); - r += s; - m = ~m; - FbByteMulAddC(d, m, r); - d = r; - } else { - r = s; - fbCombineMaskValueC (&r, &m); + FbByteAddMulC (r, m, s, dest_ia); + FbByteMulAddC (s, d, r); } *(dest + i) = r; @@ -1014,7 +1007,6 @@ fbCombineFlashSubtractC (pixman_implementation_t *imp, pixman_op_t op, fbCombineMaskC (&s, &m); m = ~m; - fbCombineMaskC (&d, &m); Subtract (r, Red); Subtract (g, Green); -- 2.7.4