diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2006-06-19 14:06:02 -0700 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2006-07-05 17:22:11 -0700 |
commit | b4a0cabc98b3b7aca05effd5d7c9b4b23096640d (patch) | |
tree | ce49d96725b94f3c46adf4ce63a1f0a896ea63bc | |
parent | fe99f25e979ef3c0e7cd8ba68ae46a7c18cb9fd3 (diff) |
Correct component ordering when fetching [ax]4b4g4r4 pixels.
Noticed by: rendercheck
(cherry picked from e793f0eeee3e9c83b6a7b50d451fb6db12839087 commit)
-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 a9ae6da4a..490a1961f 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); } |