Fix bugs in component alpha combiners for separable PDF operators
authorSøren Sandmann Pedersen <ssp@redhat.com>
Wed, 19 Sep 2012 16:04:11 +0000 (12:04 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Sun, 23 Sep 2012 03:41:19 +0000 (23:41 -0400)
In general, the component alpha version of an operator is supposed to
do this:

       - multiply source with mask in all channels
       - multiply mask with source alpha in all channels
       - compute the regular operator in all channels using the
         mask value whenever source alpha is called for

The first two steps are usually accomplished with the function
combine_mask_ca(), but for operators where source alpha is not used,
such as SRC, ADD and OUT, the simpler function
combine_mask_value_ca(), which doesn't compute the new mask values,
can be used.

However, the PDF blend modes generally *do* make use of source alpha,
so they can't use combine_mask_value_ca() as they do now. They have to
use combine_mask_ca().

This patch fixes this in combine_multiply_ca() and the CA combiners
generated by PDF_SEPARABLE_BLEND_MODE.

pixman/pixman-combine.c.template
test/blitters-test.c

index cd008d9..50d2b0a 100644 (file)
@@ -489,7 +489,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
        comp4_t r = d;
        comp4_t dest_ia = ALPHA_c (~d);
 
-       combine_mask_value_ca (&s, &m);
+       combine_mask_ca (&s, &m);
 
        UNcx4_MUL_UNcx4_ADD_UNcx4_MUL_UNc (r, ~m, s, dest_ia);
        UNcx4_MUL_UNcx4 (d, s);
@@ -546,7 +546,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
            comp1_t ida = ~da;                                          \
            comp4_t result;                                             \
                                                                        \
-           combine_mask_value_ca (&s, &m);                             \
+           combine_mask_ca (&s, &m);                                   \
                                                                        \
            result = d;                                                 \
            UNcx4_MUL_UNcx4_ADD_UNcx4_MUL_UNc (result, ~m, s, ida);     \
index 6a3cc86..8c46cef 100644 (file)
@@ -395,6 +395,6 @@ main (int argc, const char *argv[])
     }
 
     return fuzzer_test_main("blitters", 2000000,
-                           0xA364B5BF,
+                           0x3E1DD2E8,
                            test_composite, argc, argv);
 }