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)
commit2ab77c97a5a3a816d6383bdc3b6c8bdceb0383b7
treee0c4c37b8a25b0f37cb4cd8f4ad600c6ceec3856
parentc4b69e706e63e01fbc70e0026c2079007c89de14
Fix bugs in component alpha combiners for separable PDF operators

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