Fix bug in blitters-test with BGRA formats.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 18 Sep 2009 12:16:56 +0000 (08:16 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Thu, 24 Sep 2009 11:54:37 +0000 (07:54 -0400)
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.

test/blitters-test.c

index 23de6c2..6e1c5de 100644 (file)
@@ -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));