summaryrefslogtreecommitdiff
path: root/exa/exa_render.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:47:53 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:47:53 +0200
commita8d6ebdf9338dc2f6ff9a532e6fec460a70d3b1e (patch)
tree8885da72ea53e5e37ea7783604960366dbb25b10 /exa/exa_render.c
parent81b055605c34b5823f6c5f63cc0f92f43c6b7252 (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.c39
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, &region);
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 (&region, 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, &region, pSrcPixmap,
+ &srcOrg, FB_ALLONES, GXcopy);
+
+ REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+
+ if (ret)
+ goto done;
+ }
}
}