[Pixman] [PATCH 4/7] Don't consider indexed formats opaque.

Søren Sandmann sandmann at daimi.au.dk
Sat Apr 24 13:48:55 PDT 2010


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

The indexed formats have 0 bits of alpha, but can't be considered
opaque because there may be non-opaque colors in the palette.
---
 pixman/pixman-image.c |    6 ++++--
 test/blitters-test.c  |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 9604bfe..6b0dc6d 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -394,8 +394,10 @@ compute_image_info (pixman_image_t *image)
 	    }
 	}
 
-	if (image->common.repeat != PIXMAN_REPEAT_NONE &&
-	    !PIXMAN_FORMAT_A (image->bits.format))
+	if (image->common.repeat != PIXMAN_REPEAT_NONE				&&
+	    !PIXMAN_FORMAT_A (image->bits.format)				&&
+	    PIXMAN_FORMAT_TYPE (image->bits.format) != PIXMAN_TYPE_GRAY		&&
+	    PIXMAN_FORMAT_TYPE (image->bits.format) != PIXMAN_TYPE_COLOR)
 	{
 	    flags |= FAST_PATH_IS_OPAQUE;
 	}
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 5e33031..18f871e 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -482,7 +482,7 @@ main (int argc, char *argv[])
 	    /* Predefined value for running with all the fastpath functions
 	       disabled. It needs to be updated every time when changes are
 	       introduced to this program or behavior of pixman changes! */
-	    if (crc == 0xA058F792)
+	    if (crc == 0x8F9F7DC1)
 	    {
 		printf ("blitters test passed\n");
 	    }
-- 
1.7.0.1



More information about the Pixman mailing list