From: Søren Sandmann Pedersen Date: Thu, 6 Aug 2009 00:31:41 +0000 (-0400) Subject: Fix incorrect optimization in combine_over_ca(). X-Git-Tag: 1.0_branch~798^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b82cbb69197f9c367069a77ba992f3163d40230;p=profile%2Fivi%2Fpixman.git Fix incorrect optimization in combine_over_ca(). Previously the code assumed that an alpha of 0 meant that no change would take place. This is incorrect because an alpha of 0 can happen as the result of the source having alpha=0, but rgb != 0. --- diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template index 59ea1e1..f707fe9 100644 --- a/pixman/pixman-combine.c.template +++ b/pixman/pixman-combine.c.template @@ -1610,17 +1610,14 @@ combine_over_ca (pixman_implementation_t *imp, combine_mask_ca (&s, &m); a = ~m; - if (a != ~0) + if (a) { - if (a) - { - comp4_t d = *(dest + i); - UNcx4_MUL_UNcx4_ADD_UNcx4 (d, a, s); - s = d; - } - - *(dest + i) = s; + comp4_t d = *(dest + i); + UNcx4_MUL_UNcx4_ADD_UNcx4 (d, a, s); + s = d; } + + *(dest + i) = s; } }