From e156964d3e005be3dbc9ff80580d98c6dd617afd Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Fri, 18 Sep 2009 08:16:56 -0400 Subject: 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. --- test/blitters-test.c | 3 +++ 1 file changed, 3 insertions(+) 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)); -- cgit v1.2.3