diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2006-06-19 14:06:02 -0700 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2006-06-19 15:11:55 -0700 |
commit | e793f0eeee3e9c83b6a7b50d451fb6db12839087 (patch) | |
tree | 3793195a0cbd4fb351f1af60453901a03bd7d987 /fb | |
parent | e1672a12eb70836a2ceec803d505294897ae8cd2 (diff) |
Correct component ordering when fetching [ax]4b4g4r4 pixels.
Noticed by: rendercheck
Diffstat (limited to 'fb')
-rw-r--r-- | fb/fbcompose.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fb/fbcompose.c b/fb/fbcompose.c index c4f979d26..771245ef8 100644 --- a/fb/fbcompose.c +++ b/fb/fbcompose.c @@ -267,11 +267,11 @@ fbFetch_a4b4g4r4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexe CARD32 r,g,b, a; a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16; - b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; + b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - r = ((p & 0x000f) | ((p & 0x000f) << 4)); + r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; *buffer++ = (a | r | g | b); - } + } } static FASTCALL void @@ -283,11 +283,11 @@ fbFetch_x4b4g4r4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexe CARD32 p = *pixel++; CARD32 r,g,b; - b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; + b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; - r = ((p & 0x000f) | ((p & 0x000f) << 4)); + r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; *buffer++ = (0xff000000 | r | g | b); - } + } } static FASTCALL void @@ -758,9 +758,9 @@ fbFetchPixel_a4b4g4r4 (const FbBits *bits, int offset, miIndexedPtr indexed) CARD32 a,r,g,b; a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16; - b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; + b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); + r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; return (a | r | g | b); } @@ -770,9 +770,9 @@ fbFetchPixel_x4b4g4r4 (const FbBits *bits, int offset, miIndexedPtr indexed) CARD32 pixel = ((CARD16 *) bits)[offset]; CARD32 r,g,b; - b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12; + b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4; g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8; - r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)); + r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16; return (0xff000000 | r | g | b); } |