aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/xaa/xaaPict.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
committermarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
commita915739887477b28d924ecc8417ee107d125bd6c (patch)
treec02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/hw/xfree86/xaa/xaaPict.c
parent6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff)
downloadvcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/xaa/xaaPict.c')
-rw-r--r--xorg-server/hw/xfree86/xaa/xaaPict.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/xorg-server/hw/xfree86/xaa/xaaPict.c b/xorg-server/hw/xfree86/xaa/xaaPict.c
index 784c649a4..e059d3d65 100644
--- a/xorg-server/hw/xfree86/xaa/xaaPict.c
+++ b/xorg-server/hw/xfree86/xaa/xaaPict.c
@@ -75,12 +75,18 @@ XAAGetPixelFromRGBA (
gshift = bbits;
rshift = gshift + gbits;
ashift = rshift + rbits;
- } else { /* PICT_TYPE_ABGR */
+ } else if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) {
rshift = 0;
gshift = rbits;
bshift = gshift + gbits;
ashift = bshift + bbits;
- }
+ } else if(PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
+ bshift = PICT_FORMAT_BPP(format) - bbits;
+ gshift = bshift - gbits;
+ rshift = gshift - rbits;
+ ashift = 0;
+ } else
+ return FALSE;
*pixel |= ( blue >> (16 - bbits)) << bshift;
*pixel |= ( red >> (16 - rbits)) << rshift;
@@ -116,12 +122,18 @@ XAAGetRGBAFromPixel(
gshift = bbits;
rshift = gshift + gbits;
ashift = rshift + rbits;
- } else { /* PICT_TYPE_ABGR */
+ } else if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) {
rshift = 0;
gshift = rbits;
bshift = gshift + gbits;
ashift = bshift + bbits;
- }
+ } else if(PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
+ bshift = PICT_FORMAT_BPP(format) - bbits;
+ gshift = bshift - gbits;
+ rshift = gshift - rbits;
+ ashift = 0;
+ } else
+ return FALSE;
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
while(rbits < 16) {