diff options
author | Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> | 2007-04-25 12:34:19 -0400 |
---|---|---|
committer | Soren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com> | 2007-04-25 22:22:22 -0400 |
commit | c19ece1d8c32dc81740a4036a642661f54064e75 (patch) | |
tree | bd72988b6f3f0b195bf556f6358de80b55f133e9 /fb/fbpict.c | |
parent | 48c73dfc369fdf8f6023436ebe82bb604f76bb80 (diff) |
Integrate optimization from xserver from David Reveman where repeats
get handled by fbFetchTransformed() rather than in the region walking
code.
Diffstat (limited to 'fb/fbpict.c')
-rw-r--r-- | fb/fbpict.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/fb/fbpict.c b/fb/fbpict.c index b9c463aa5..b4cddd767 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -1463,6 +1463,8 @@ fbComposite (CARD8 op, CompositeFunc func = NULL; Bool srcRepeat = pSrc->pDrawable && pSrc->repeat; Bool maskRepeat = FALSE; + Bool srcTransform = pSrc->pDrawable && pSrc->transform; + Bool maskTransform = FALSE; Bool srcAlphaMap = pSrc->alphaMap != 0; Bool maskAlphaMap = FALSE; Bool dstAlphaMap = pDst->alphaMap != 0; @@ -1476,23 +1478,42 @@ fbComposite (CARD8 op, mmx_setup = TRUE; } #endif - + + if (pSrc->filter == PictFilterConvolution) + srcTransform = TRUE; + xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; if (pSrc->pDrawable) { xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; } + + if (srcRepeat && srcTransform && + pSrc->pDrawable->width == 1 && + pSrc->pDrawable->height == 1) + srcTransform = FALSE; + if (pMask && pMask->pDrawable) { xMask += pMask->pDrawable->x; yMask += pMask->pDrawable->y; maskRepeat = pMask->repeat == RepeatNormal; + + if (pMask->filter == PictFilterConvolution) + maskTransform = TRUE; + maskAlphaMap = pMask->alphaMap != 0; + + if (maskRepeat && maskTransform && + pMask->pDrawable->width == 1 && + pMask->pDrawable->height == 1) + maskTransform = FALSE; + } if (pSrc->pDrawable && (!pMask || pMask->pDrawable) - && !pSrc->transform && !(pMask && pMask->transform) + && !srcTransform && !maskTransform && !maskAlphaMap && !srcAlphaMap && !dstAlphaMap && (pSrc->filter != PictFilterConvolution) && (!pMask || pMask->filter != PictFilterConvolution)) @@ -1977,6 +1998,12 @@ fbComposite (CARD8 op, height)) return; + /* if we are transforming, we handle repeats in fbFetchTransformed */ + if (srcTransform) + srcRepeat = FALSE; + if (maskTransform) + maskRepeat = FALSE; + n = REGION_NUM_RECTS (®ion); pbox = REGION_RECTS (®ion); while (n--) |