From efdf15e677d506c2049a34e92eb2172712101afa Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Fri, 18 Sep 2009 08:48:04 -0400 Subject: [PATCH] Fix shift bug in fetch_scanline/pixel_a2b2g2r2() 0x30 * 0x55 is 0xff0, so the red channel should be shifted four bits, not six. --- pixman/pixman-access.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index 41cd1b6..06b8411 100644 --- a/pixman/pixman-access.c +++ b/pixman/pixman-access.c @@ -798,7 +798,7 @@ fetch_scanline_a2b2g2r2 (pixman_image_t *image, uint32_t a, r, g, b; a = ((p & 0xc0) * 0x55) << 18; - b = ((p & 0x30) * 0x55) >> 6; + b = ((p & 0x30) * 0x55) >> 4; g = ((p & 0x0c) * 0x55) << 6; r = ((p & 0x03) * 0x55) << 16; @@ -1594,7 +1594,7 @@ fetch_pixel_a2b2g2r2 (bits_image_t *image, uint32_t a, r, g, b; a = ((pixel & 0xc0) * 0x55) << 18; - b = ((pixel & 0x30) * 0x55) >> 6; + b = ((pixel & 0x30) * 0x55) >> 4; g = ((pixel & 0x0c) * 0x55) << 6; r = ((pixel & 0x03) * 0x55) << 16; -- 2.7.4