summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2013-11-23 20:30:33 -0500
committerSøren Sandmann <ssp@redhat.com>2013-11-23 20:30:33 -0500
commit9ba3a34797399b286dbfe21c7b213a7547abf577 (patch)
treeab3b6dd65cc119e1124ae76f13ca8cad3bd1c041
parentf473fd1e7553a4e92a0d72bea360f05d005c9a88 (diff)
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.
-rw-r--r--pixman/pixman-general.c6
-rw-r--r--test/blitters-test.c2
-rw-r--r--test/composite.c11
3 files changed, 2 insertions, 17 deletions
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);