diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-04-29 23:47:53 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-04-29 23:47:53 +0200 |
commit | a8d6ebdf9338dc2f6ff9a532e6fec460a70d3b1e (patch) | |
tree | 8885da72ea53e5e37ea7783604960366dbb25b10 /exa/exa_render.c | |
parent | 81b055605c34b5823f6c5f63cc0f92f43c6b7252 (diff) |
EXA: Defer to FillRegionTiled in Composite when possible.
Committed separately as this case is hard to hit and has only been tested
lightly.
Diffstat (limited to 'exa/exa_render.c')
-rw-r--r-- | exa/exa_render.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/exa/exa_render.c b/exa/exa_render.c index 63a412c5f..06881e39f 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -651,6 +651,45 @@ exaComposite(CARD8 op, REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); goto done; } + else if (pSrcPixmap && !pSrc->transform && + pSrc->repeatType == RepeatNormal) + { + RegionRec region; + DDXPointRec srcOrg; + + /* Let's see if the driver can do the repeat in one go */ + if (pExaScr->info->PrepareComposite && !pSrc->alphaMap && + !pDst->alphaMap) + { + ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, + ySrc, xMask, yMask, xDst, yDst, + width, height); + if (ret == 1) + goto done; + } + + /* Now see if we can use exaFillRegionTiled() */ + xDst += pDst->pDrawable->x; + yDst += pDst->pDrawable->y; + xSrc += pSrc->pDrawable->x; + ySrc += pSrc->pDrawable->y; + + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, + ySrc, xMask, yMask, xDst, yDst, + width, height)) + goto done; + + srcOrg.x = (xSrc - xDst) % pSrcPixmap->drawable.width; + srcOrg.y = (ySrc - yDst) % pSrcPixmap->drawable.height; + + ret = exaFillRegionTiled(pDst->pDrawable, ®ion, pSrcPixmap, + &srcOrg, FB_ALLONES, GXcopy); + + REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + + if (ret) + goto done; + } } } |