summaryrefslogtreecommitdiff
path: root/fb/fbcompose.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-06-19 16:42:09 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-06-19 16:42:09 -0700
commit569c808a2375be71f835ee8693605487484bd22e (patch)
treeabae2371737ba0945a29f24dd3606dbb9c4e6712 /fb/fbcompose.c
parent55426650417df4ec22ea0e2a67f6074f0ac1d54e (diff)
Fix crash when using PICT_x4a4 by supplying an appropriate fbFetchPixel_x4a4.
Diffstat (limited to 'fb/fbcompose.c')
-rw-r--r--fb/fbcompose.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index 771245ef8..41fff7b8a 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -849,6 +849,14 @@ fbFetchPixel_c8 (const FbBits *bits, int offset, miIndexedPtr indexed)
return indexed->rgba[pixel];
}
+static FASTCALL CARD32
+fbFetchPixel_x4a4 (const FbBits *bits, int offset, miIndexedPtr indexed)
+{
+ CARD32 pixel = ((CARD8 *) bits)[offset];
+
+ return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24;
+}
+
#define Fetch8(l,o) (((CARD8 *) (l))[(o) >> 2])
#if IMAGE_BYTE_ORDER == MSBFirst
#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
@@ -988,6 +996,7 @@ static fetchPixelProc fetchPixelProcForPicture (PicturePtr pict)
case PICT_a2b2g2r2: return fbFetchPixel_a2b2g2r2;
case PICT_c8: return fbFetchPixel_c8;
case PICT_g8: return fbFetchPixel_c8;
+ case PICT_x4a4: return fbFetchPixel_x4a4;
/* 4bpp formats */
case PICT_a4: return fbFetchPixel_a4;