[Pixman] [PATCH] Only regard images as pixbufs if they have identity transformations

Søren Sandmann sandmann at cs.au.dk
Sun Oct 7 17:28:02 PDT 2012


From: Søren Sandmann Pedersen <ssp at redhat.com>

In order for a src/mask pair to be considered a pixbuf, they have to
have identical transformations, but we don't check for that. Since the
only fast paths we have for pixbufs require identity transformations,
it sufficies to check that both source and mask are
untransformed.

This is also the reason that this bug can't be triggered by any test
code - if the source and mask had different transformations, we would
consider them a pixbuf, but then wouldn't take the fast path because
at least one of the transformations would be different from the
identity.
---
 pixman/pixman.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pixman/pixman.c b/pixman/pixman.c
index bbe8b08..e3b6516 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -605,6 +605,7 @@ pixman_image_composite32 (pixman_op_t      op,
     if ((mask_format == PIXMAN_a8r8g8b8 || mask_format == PIXMAN_a8b8g8r8) &&
 	(src->type == BITS && src->bits.bits == mask->bits.bits)	   &&
 	(src->common.repeat == mask->common.repeat)			   &&
+	(src_flags & mask_flags & FAST_PATH_ID_TRANSFORM)		   &&
 	(src_x == mask_x && src_y == mask_y))
     {
 	if (src_format == PIXMAN_x8b8g8r8)
-- 
1.7.11.4



More information about the Pixman mailing list