[xserver-commit] xserver/fb fbcompose.c,1.17,1.18

Jaymz Julian xserver-commit@pdx.freedesktop.org
Thu, 18 Dec 2003 04:19:50 -0800


Committed by: jaymz

Update of /cvs/xserver/xserver/fb
In directory pdx:/tmp/cvs-serv28385/fb

Modified Files:
	fbcompose.c 
Log Message:

Read unaligned in 24bpp rgb packed pixel on architectures which allow it
(trivial for the bgr case as well, but my video card doens't do that, so
I didn't implent it)



Index: fbcompose.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbcompose.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- fbcompose.c	11 Sep 2003 05:12:50 -0000	1.17
+++ fbcompose.c	18 Dec 2003 12:19:47 -0000	1.18
@@ -1649,15 +1649,20 @@
     FbBits  *line = op->u.drawable.line; CARD32 offset = op->u.drawable.offset;
     CARD8   *pixel = ((CARD8 *) line) + (offset >> 3);
 #if IMAGE_BYTE_ORDER == MSBFirst
+    // FIXME: implent WORKING_UNALIGNED_INT for this endian :)
     return (0xff000000 |
 	    (pixel[0] << 16) |
 	    (pixel[1] << 8) |
 	    (pixel[2]));
 #else
-    return (0xff000000 |
-	    (pixel[2] << 16) |
-	    (pixel[1] << 8) |
-	    (pixel[0]));
+	#ifdef WORKING_UNALIGNED_INT
+		return *(CARD32 *)pixel|0xff000000;
+	#else
+	    return (0xff000000 |
+		    (pixel[2] << 16) |
+		    (pixel[1] << 8) |
+		    (pixel[0]));
+	#endif
 #endif
 }