summaryrefslogtreecommitdiff
path: root/fb/fbpict.c
diff options
context:
space:
mode:
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-04-26 10:24:25 -0400
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-04-26 10:24:25 -0400
commita54ef54db19dcd36ed86b33cff2bc369f9690a15 (patch)
tree8d9e4d2824b7e50fe5964f052e3b70e66e9ebbf5 /fb/fbpict.c
parent3571b8e65b0857322d12e291305cfe29ea497c3c (diff)
Pixman merge
Make sure fbCompositeSrc_x888x8x8888mmx and fbCompositeSrc_8888x8x8888mmx are used when possible.
Diffstat (limited to 'fb/fbpict.c')
-rw-r--r--fb/fbpict.c77
1 files changed, 44 insertions, 33 deletions
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 4fb949dcc..1932b3e65 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1647,7 +1647,7 @@ fbComposite (CARD8 op,
if (func != fbCompositeGeneral)
srcRepeat = FALSE;
}
- else if (! srcRepeat) /* has mask and non-repeating source */
+ else if (!srcRepeat) /* has mask and non-repeating source */
{
if (pSrc->pDrawable == pMask->pDrawable &&
xSrc == xMask && ySrc == yMask &&
@@ -1712,44 +1712,55 @@ fbComposite (CARD8 op,
}
break;
}
- else
+ else if (maskRepeat &&
+ pMask->pDrawable->width == 1 &&
+ pMask->pDrawable->height == 1)
{
- /* non-repeating source, repeating mask => translucent window */
- if (fbCanGetSolid(pMask))
- {
- if (pSrc->format == PICT_x8r8g8b8 &&
- pDst->format == PICT_x8r8g8b8 &&
- pMask->format == PICT_a8)
- {
+ switch (pSrc->format) {
+ case PICT_r5g6b5:
+ case PICT_b5g6r5:
+ if (pDst->format == pSrc->format)
+ func = fbCompositeTrans_0565xnx0565;
+ break;
+ case PICT_r8g8b8:
+ case PICT_b8g8r8:
+ if (pDst->format == pSrc->format)
+ func = fbCompositeTrans_0888xnx0888;
+ break;
#ifdef USE_MMX
- if (fbHaveMMX())
- func = fbCompositeSrc_8888x8x8888mmx;
+ case PICT_x8r8g8b8:
+ if ((pDst->format == PICT_a8r8g8b8 ||
+ pDst->format == PICT_x8r8g8b8) &&
+ pMask->format == PICT_a8 && fbHaveMMX())
+ func = fbCompositeSrc_x888x8x8888mmx;
+ break;
+ case PICT_x8b8g8r8:
+ if ((pDst->format == PICT_a8b8g8r8 ||
+ pDst->format == PICT_x8b8g8r8) &&
+ pMask->format == PICT_a8 && fbHaveMMX())
+ func = fbCompositeSrc_x888x8x8888mmx;
+ break;
+ case PICT_a8r8g8b8:
+ if ((pDst->format == PICT_a8r8g8b8 ||
+ pDst->format == PICT_x8r8g8b8) &&
+ pMask->format == PICT_a8 && fbHaveMMX())
+ func = fbCompositeSrc_8888x8x8888mmx;
+ break;
+ case PICT_a8b8g8r8:
+ if ((pDst->format == PICT_a8b8g8r8 ||
+ pDst->format == PICT_x8b8g8r8) &&
+ pMask->format == PICT_a8 && fbHaveMMX())
+ func = fbCompositeSrc_8888x8x8888mmx;
+ break;
#endif
- }
+ default:
+ break;
}
+
+ if (func != fbCompositeGeneral)
+ maskRepeat = FALSE;
}
}
- else if (maskRepeat &&
- pMask->pDrawable->width == 1 &&
- pMask->pDrawable->height == 1)
- {
- switch (pSrc->format) {
- case PICT_r5g6b5:
- case PICT_b5g6r5:
- if (pDst->format == pSrc->format)
- func = fbCompositeTrans_0565xnx0565;
- break;
- case PICT_r8g8b8:
- case PICT_b8g8r8:
- if (pDst->format == pSrc->format)
- func = fbCompositeTrans_0888xnx0888;
- break;
- default:
- break;
- }
- if (func != fbCompositeGeneral)
- maskRepeat = FALSE;
- }
}
else /* no mask */
{