From: Søren Sandmann Pedersen Date: Tue, 5 Oct 2010 15:08:42 +0000 (-0400) Subject: Remove broken optimizations in combine_disjoint_over_u() X-Git-Tag: pixman-0.19.6~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e89a5b7f3b039fcc86dff7fb8bec79884c913e8;p=platform%2Fupstream%2Fpixman.git Remove broken optimizations in combine_disjoint_over_u() The first broken optimization is that it checks "a != 0x00" where it should check "s != 0x00". The other is that it skips the computation when alpha is 0xff. That is wrong because in the formula: min (1, (1 - Aa)/Ab) the render specification states that if Ab is 0, the quotient is defined to positive infinity. That is the case even if (1 - Aa) is 0. --- diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template index c129980..0d3b95d 100644 --- a/pixman/pixman-combine.c.template +++ b/pixman/pixman-combine.c.template @@ -1296,17 +1296,13 @@ combine_disjoint_over_u (pixman_implementation_t *imp, comp4_t s = combine_mask (src, mask, i); comp2_t a = s >> A_SHIFT; - if (a != 0x00) + if (s != 0x00) { - if (a != MASK) - { - comp4_t d = *(dest + i); - a = combine_disjoint_out_part (d >> A_SHIFT, a); - UNcx4_MUL_UNc_ADD_UNcx4 (d, a, s); - s = d; - } + comp4_t d = *(dest + i); + a = combine_disjoint_out_part (d >> A_SHIFT, a); + UNcx4_MUL_UNc_ADD_UNcx4 (d, a, s); - *(dest + i) = s; + *(dest + i) = d; } } } diff --git a/test/blitters-test.c b/test/blitters-test.c index 7ba80eb..77a26dd 100644 --- a/test/blitters-test.c +++ b/test/blitters-test.c @@ -465,6 +465,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0x217CF14A, + 0x1DB8BDF8, test_composite, argc, argv); }