From: Søren Sandmann Date: Sun, 24 Nov 2013 01:30:33 +0000 (-0500) Subject: general: Support component alpha for all image types X-Git-Tag: pixman-0.33.2~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ba3a34797399b286dbfe21c7b213a7547abf577;p=platform%2Fupstream%2Fpixman.git general: Support component alpha for all image types Currently, if you attempt to use component alpha on source images or images without RGB channels, Pixman will silently just use unified alpha instead. This patch makes such images supported for component alpha. There is no particularly compelling usecase at the moment, but this patch does get rid of a bit of special-case code both in pixman-general.c and in test/composite.c. --- diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index a653fa7..8bce7c0 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -183,11 +183,7 @@ general_composite_rect (pixman_implementation_t *imp, mask_image = NULL; } - component_alpha = - mask_image && - mask_image->common.type == BITS && - mask_image->common.component_alpha && - PIXMAN_FORMAT_RGB (mask_image->bits.format); + component_alpha = mask_image && mask_image->common.component_alpha; _pixman_implementation_iter_init ( imp->toplevel, &mask_iter, diff --git a/test/blitters-test.c b/test/blitters-test.c index ea03f47..df82358 100644 --- a/test/blitters-test.c +++ b/test/blitters-test.c @@ -394,6 +394,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0xE0A07495, + 0x63B4E3F3, test_composite, argc, argv); } diff --git a/test/composite.c b/test/composite.c index 9e51a8f..594c697 100644 --- a/test/composite.c +++ b/test/composite.c @@ -299,17 +299,6 @@ composite_test (image_t *dst, } } - if (mask) - { - if (component_alpha && PIXMAN_FORMAT_R (mask->format) == 0) - { - /* Ax component-alpha masks expand alpha into - * all color channels. - */ - tmsk.r = tmsk.g = tmsk.b = tmsk.a; - } - } - if (PIXMAN_FORMAT_TYPE (dst->format) == PIXMAN_TYPE_ARGB_SRGB) { tdst.r = convert_linear_to_srgb (tdst.r);