[cairo-commit] cairo/pixman/src fbcompose.c, 1.3, 1.4 fbmmx.c, 1.5, 1.6 fbpict.c, 1.5, 1.6 fbpict.h, 1.1, 1.2

Owen Taylor commit at pdx.freedesktop.org
Mon Sep 12 05:55:13 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/pixman/src
In directory gabe:/tmp/cvs-serv24445/src

Modified Files:
	fbcompose.c fbmmx.c fbpict.c fbpict.h 
Log Message:
2005-08-28  Owen Taylor  <otaylor at redhat.com>

        Bug #4260, Reviewed by B. Biggs

        * src/fbcompose.c (fbStore_a8b8g8r8, fbStore_x8b8g8r8): Use & not
        && for bitwise AND.

        * src/fbpict.h (fbComposeGetSolid) src/fbpict.c src/fbmmx.c: Take
        'dest' as an argument, if pict and dest don't match for RGB, BGR,
        swap result.


Index: fbcompose.c
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/fbcompose.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- fbcompose.c	28 Aug 2005 02:32:57 -0000	1.3
+++ fbcompose.c	12 Sep 2005 12:55:11 -0000	1.4
@@ -1049,7 +1049,7 @@
     int i;
     CARD32 *pixel = (CARD32 *)bits + x;
     for (i = 0; i < width; ++i)
-        *pixel++ = (values[i] & 0xff00ff00) | ((values[i] >> 16) && 0xff) | ((values[i] & 0xff) << 16);
+        *pixel++ = (values[i] & 0xff00ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16);
 }
 
 static FASTCALL void
@@ -1058,7 +1058,7 @@
     int i;
     CARD32 *pixel = (CARD32 *)bits + x;
     for (i = 0; i < width; ++i)
-        *pixel++ = (values[i] & 0x0000ff00) | ((values[i] >> 16) && 0xff) | ((values[i] & 0xff) << 16);
+        *pixel++ = (values[i] & 0x0000ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16);
 }
 
 static FASTCALL void

Index: fbmmx.c
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/fbmmx.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fbmmx.c	28 Aug 2005 19:52:10 -0000	1.5
+++ fbmmx.c	12 Sep 2005 12:55:11 -0000	1.6
@@ -886,7 +886,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     if (src >> 24 == 0)
 	return;
@@ -964,7 +964,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     if (src >> 24 == 0)
 	return;
@@ -1049,7 +1049,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     srca = src >> 24;
     if (srca == 0)
@@ -1424,7 +1424,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     srca = src >> 24;
     if (srca == 0)
@@ -1539,7 +1539,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     srca = src >> 24;
     if (srca == 0)
@@ -1670,7 +1670,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     srca = src >> 24;
     if (srca == 0)
@@ -2011,7 +2011,7 @@
     
     CHECKPOINT();
     
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
     
     srca = src >> 24;
     if (srca == 0)

Index: fbpict.c
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/fbpict.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fbpict.c	28 Aug 2005 02:32:57 -0000	1.5
+++ fbpict.c	12 Sep 2005 12:55:11 -0000	1.6
@@ -169,7 +169,7 @@
     FbStride	dstStride, maskStride;
     CARD16	w;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     dstMask = FbFullMask (pDst->pDrawable->depth);
     srca = src >> 24;
@@ -228,7 +228,7 @@
     CARD16	w;
     CARD32	m, n, o, p;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     dstMask = FbFullMask (pDst->pDrawable->depth);
     srca = src >> 24;
@@ -302,7 +302,7 @@
     CARD16	w;
 	CARD32 rs,gs,bs,rd,gd,bd;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     srca = src >> 24;
     srcia = 255-srca;
@@ -398,7 +398,7 @@
     FbStride	dstStride, maskStride;
     CARD16	w,src16;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     if (src == 0)
 	return;
@@ -476,7 +476,7 @@
     FbStride	dstStride, maskStride;
     CARD16	w, src16;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     if (src == 0)
 	return;
@@ -555,7 +555,7 @@
     CARD16	w;
     CARD32	m, n, o;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     srca = src >> 24;
     if (src == 0)
@@ -926,7 +926,7 @@
     int		maskXoff, maskYoff;
     FbBits	src;
 
-    fbComposeGetSolid(pSrc, src);
+    fbComposeGetSolid(pSrc, pDst, src);
 
     if ((src & 0xff000000) != 0xff000000)
     {
@@ -1008,7 +1008,7 @@
     CARD16	s_16, d_16;
     CARD32	s_32, d_32;
 
-    fbComposeGetSolid (pMask, mask);
+    fbComposeGetSolid (pMask, pDst, mask);
     maskAlpha = mask >> 27;
 
     if (!maskAlpha)
@@ -1110,7 +1110,7 @@
     FbBits	mask;
     CARD16	maskAlpha,maskiAlpha;
 
-    fbComposeGetSolid (pMask, mask);
+    fbComposeGetSolid (pMask, pDst, mask);
     maskAlpha = mask >> 24;
 	maskiAlpha= 255-maskAlpha;
 

Index: fbpict.h
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/fbpict.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fbpict.h	11 Aug 2005 04:10:13 -0000	1.1
+++ fbpict.h	12 Sep 2005 12:55:11 -0000	1.2
@@ -67,7 +67,9 @@
 #define Green(x) (((x) >> 8) & 0xff)
 #define Blue(x) ((x) & 0xff)
 
-#define fbComposeGetSolid(pict, bits) { \
+#define IsRGB(pict) ((pict)->image_format.red > (pict)->image_format.blue)
+
+#define fbComposeGetSolid(pict, dest, bits) { \
     FbBits	*__bits__; \
     FbStride	__stride__; \
     int		__bpp__; \
@@ -99,6 +101,12 @@
     /* manage missing src alpha */ \
     if ((pict)->image_format.alphaMask == 0) \
 	(bits) |= 0xff000000; \
+    /* Handle RGB/BGR mismatch */ \
+    if (dest && IsRGB(dest) != IsRGB(pict)) \
+        bits = (((bits & 0xff000000)) | \
+		((bits & 0x00ff0000) >> 16) | \
+		((bits & 0x0000ff00)) | \
+		((bits & 0x000000ff) << 16)); \
 }
 
 #define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\



More information about the cairo-commit mailing list