Integrate optimization from xserver from David Reveman where repeats
get handled by fbFetchTransformed() rather than in the region walking code.
This commit is contained in:
parent
48c73dfc36
commit
c19ece1d8c
31
fb/fbpict.c
31
fb/fbpict.c
|
@ -1463,6 +1463,8 @@ fbComposite (CARD8 op,
|
||||||
CompositeFunc func = NULL;
|
CompositeFunc func = NULL;
|
||||||
Bool srcRepeat = pSrc->pDrawable && pSrc->repeat;
|
Bool srcRepeat = pSrc->pDrawable && pSrc->repeat;
|
||||||
Bool maskRepeat = FALSE;
|
Bool maskRepeat = FALSE;
|
||||||
|
Bool srcTransform = pSrc->pDrawable && pSrc->transform;
|
||||||
|
Bool maskTransform = FALSE;
|
||||||
Bool srcAlphaMap = pSrc->alphaMap != 0;
|
Bool srcAlphaMap = pSrc->alphaMap != 0;
|
||||||
Bool maskAlphaMap = FALSE;
|
Bool maskAlphaMap = FALSE;
|
||||||
Bool dstAlphaMap = pDst->alphaMap != 0;
|
Bool dstAlphaMap = pDst->alphaMap != 0;
|
||||||
|
@ -1476,23 +1478,42 @@ fbComposite (CARD8 op,
|
||||||
mmx_setup = TRUE;
|
mmx_setup = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (pSrc->filter == PictFilterConvolution)
|
||||||
|
srcTransform = TRUE;
|
||||||
|
|
||||||
xDst += pDst->pDrawable->x;
|
xDst += pDst->pDrawable->x;
|
||||||
yDst += pDst->pDrawable->y;
|
yDst += pDst->pDrawable->y;
|
||||||
if (pSrc->pDrawable) {
|
if (pSrc->pDrawable) {
|
||||||
xSrc += pSrc->pDrawable->x;
|
xSrc += pSrc->pDrawable->x;
|
||||||
ySrc += pSrc->pDrawable->y;
|
ySrc += pSrc->pDrawable->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (srcRepeat && srcTransform &&
|
||||||
|
pSrc->pDrawable->width == 1 &&
|
||||||
|
pSrc->pDrawable->height == 1)
|
||||||
|
srcTransform = FALSE;
|
||||||
|
|
||||||
if (pMask && pMask->pDrawable)
|
if (pMask && pMask->pDrawable)
|
||||||
{
|
{
|
||||||
xMask += pMask->pDrawable->x;
|
xMask += pMask->pDrawable->x;
|
||||||
yMask += pMask->pDrawable->y;
|
yMask += pMask->pDrawable->y;
|
||||||
maskRepeat = pMask->repeat == RepeatNormal;
|
maskRepeat = pMask->repeat == RepeatNormal;
|
||||||
|
|
||||||
|
if (pMask->filter == PictFilterConvolution)
|
||||||
|
maskTransform = TRUE;
|
||||||
|
|
||||||
maskAlphaMap = pMask->alphaMap != 0;
|
maskAlphaMap = pMask->alphaMap != 0;
|
||||||
|
|
||||||
|
if (maskRepeat && maskTransform &&
|
||||||
|
pMask->pDrawable->width == 1 &&
|
||||||
|
pMask->pDrawable->height == 1)
|
||||||
|
maskTransform = FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSrc->pDrawable && (!pMask || pMask->pDrawable)
|
if (pSrc->pDrawable && (!pMask || pMask->pDrawable)
|
||||||
&& !pSrc->transform && !(pMask && pMask->transform)
|
&& !srcTransform && !maskTransform
|
||||||
&& !maskAlphaMap && !srcAlphaMap && !dstAlphaMap
|
&& !maskAlphaMap && !srcAlphaMap && !dstAlphaMap
|
||||||
&& (pSrc->filter != PictFilterConvolution)
|
&& (pSrc->filter != PictFilterConvolution)
|
||||||
&& (!pMask || pMask->filter != PictFilterConvolution))
|
&& (!pMask || pMask->filter != PictFilterConvolution))
|
||||||
|
@ -1977,6 +1998,12 @@ fbComposite (CARD8 op,
|
||||||
height))
|
height))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* if we are transforming, we handle repeats in fbFetchTransformed */
|
||||||
|
if (srcTransform)
|
||||||
|
srcRepeat = FALSE;
|
||||||
|
if (maskTransform)
|
||||||
|
maskRepeat = FALSE;
|
||||||
|
|
||||||
n = REGION_NUM_RECTS (®ion);
|
n = REGION_NUM_RECTS (®ion);
|
||||||
pbox = REGION_RECTS (®ion);
|
pbox = REGION_RECTS (®ion);
|
||||||
while (n--)
|
while (n--)
|
||||||
|
|
Loading…
Reference in New Issue