summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-18 08:16:56 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-24 07:54:37 -0400
commite156964d3e005be3dbc9ff80580d98c6dd617afd (patch)
tree61583708c797ded3351b3005bb413738d2724c5c
parenteb72bfb97d10283964c070f0a0e26f0520a22ff3 (diff)
Fix bug in blitters-test with BGRA formats.
When masking out the x bits, blitter-test would make the incorrect assumption that the they were always in the topmost position. This is not correct for formats of type PIXMAN_TYPE_BGRA.
-rw-r--r--test/blitters-test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 23de6c2..6e1c5de 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -314,6 +314,9 @@ free_random_image (uint32_t initcrc,
uint32_t *data = pixman_image_get_data (img);
uint32_t mask = (1 << PIXMAN_FORMAT_DEPTH (fmt)) - 1;
+ if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_BGRA)
+ mask <<= (PIXMAN_FORMAT_BPP (fmt) - PIXMAN_FORMAT_DEPTH (fmt));
+
for (i = 0; i < 32; i++)
mask |= mask << (i * PIXMAN_FORMAT_BPP (fmt));