Index: pixman/ChangeLog =================================================================== RCS file: /cvs/cairo/cairo/pixman/ChangeLog,v retrieving revision 1.115 diff -u -p -r1.115 ChangeLog --- pixman/ChangeLog 28 Aug 2005 01:36:09 -0000 1.115 +++ pixman/ChangeLog 28 Aug 2005 19:34:11 -0000 @@ -1,3 +1,12 @@ +2005-08-28 Owen Taylor + + * 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. + 2005-08-27 Owen Taylor * src/fbmmx.c (detectCPUFeatures): Make the code work with Index: pixman/src/fbcompose.c =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/fbcompose.c,v retrieving revision 1.2 diff -u -p -r1.2 fbcompose.c --- pixman/src/fbcompose.c 19 Aug 2005 01:46:30 -0000 1.2 +++ pixman/src/fbcompose.c 28 Aug 2005 19:34:11 -0000 @@ -1049,7 +1049,7 @@ fbStore_a8b8g8r8 (FbBits *bits, const CA 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 @@ fbStore_x8b8g8r8 (FbBits *bits, const CA 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: pixman/src/fbmmx.c =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/fbmmx.c,v retrieving revision 1.4 diff -u -p -r1.4 fbmmx.c --- pixman/src/fbmmx.c 28 Aug 2005 01:36:09 -0000 1.4 +++ pixman/src/fbmmx.c 28 Aug 2005 19:34:11 -0000 @@ -886,7 +886,7 @@ fbCompositeSolid_nx8888mmx (pixman_opera CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); if (src >> 24 == 0) return; @@ -964,7 +964,7 @@ fbCompositeSolid_nx0565mmx (pixman_opera CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); if (src >> 24 == 0) return; @@ -1049,7 +1049,7 @@ fbCompositeSolidMask_nx8888x8888Cmmx (pi CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (srca == 0) @@ -1424,7 +1424,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (srca == 0) @@ -1539,7 +1539,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pix CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (srca == 0) @@ -1670,7 +1670,7 @@ fbCompositeSolidMask_nx8x0565mmx (pixman CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (srca == 0) @@ -2011,7 +2011,7 @@ fbCompositeSolidMask_nx8888x0565Cmmx (pi CHECKPOINT(); - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (srca == 0) Index: pixman/src/fbpict.c =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/fbpict.c,v retrieving revision 1.4 diff -u -p -r1.4 fbpict.c --- pixman/src/fbpict.c 22 Aug 2005 03:49:47 -0000 1.4 +++ pixman/src/fbpict.c 28 Aug 2005 19:34:11 -0000 @@ -169,7 +169,7 @@ fbCompositeSolidMask_nx8x8888 (pixman_op FbStride dstStride, maskStride; CARD16 w; - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); dstMask = FbFullMask (pDst->pDrawable->depth); srca = src >> 24; @@ -228,7 +228,7 @@ fbCompositeSolidMask_nx8888x8888C (pixma 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 @@ fbCompositeSolidMask_nx8x0888 (pixman_op 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 @@ fbCompositeSolidMask_nx8x0565 (pixman_op FbStride dstStride, maskStride; CARD16 w,src16; - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); if (src == 0) return; @@ -476,7 +476,7 @@ fbCompositeSolidMask_nx8888x0565 (pixman FbStride dstStride, maskStride; CARD16 w, src16; - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); if (src == 0) return; @@ -555,7 +555,7 @@ fbCompositeSolidMask_nx8888x0565C (pixma CARD16 w; CARD32 m, n, o; - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); srca = src >> 24; if (src == 0) @@ -926,7 +926,7 @@ fbCompositeSolidMask_nx1xn (pixman_opera int maskXoff, maskYoff; FbBits src; - fbComposeGetSolid(pSrc, src); + fbComposeGetSolid(pSrc, pDst, src); if ((src & 0xff000000) != 0xff000000) { @@ -1008,7 +1008,7 @@ fbCompositeTrans_0565xnx0565(pixman_oper 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 @@ fbCompositeTrans_0888xnx0888(pixman_oper FbBits mask; CARD16 maskAlpha,maskiAlpha; - fbComposeGetSolid (pMask, mask); + fbComposeGetSolid (pMask, pDst, mask); maskAlpha = mask >> 24; maskiAlpha= 255-maskAlpha; Index: pixman/src/fbpict.h =================================================================== RCS file: /cvs/cairo/cairo/pixman/src/fbpict.h,v retrieving revision 1.1 diff -u -p -r1.1 fbpict.h --- pixman/src/fbpict.h 11 Aug 2005 04:10:13 -0000 1.1 +++ pixman/src/fbpict.h 28 Aug 2005 19:34:11 -0000 @@ -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) {\