summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-19 16:18:40 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-05-25 16:32:43 +0100
commit28695bebe30555e148b96046d53ac38747744fd0 (patch)
tree8db8ea0c72730f444cfef21fa6e80adfff404dc9
parenteecec5b7c557d18f2d257e0c41f6040c5825967c (diff)
uxa: translate the region in line for composites
When compositing, we need to convert the box into a rect and so the advantages of using REGION_TRANSLATE are lost. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit c2abf8d659b8b161a4f9df100b614ee3c8f8e458) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--uxa/uxa-render.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 0ea6acff..48953eb5 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -370,8 +370,6 @@ uxa_try_driver_solid_fill(PicturePtr pSrc,
width, height))
return 1;
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
-
if (pSrcPix) {
if (! uxa_get_color_for_pixmap (pSrcPix, pSrc->format, pDst->format, &pixel)) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
@@ -395,6 +393,8 @@ uxa_try_driver_solid_fill(PicturePtr pSrc,
return -1;
}
+ REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
+
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
@@ -1053,21 +1053,19 @@ uxa_try_driver_composite_rects(CARD8 op,
rects->width, rects->height))
goto next_rect;
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
+ xSrc = xSrc + src_off_x - xDst;
+ ySrc = ySrc + src_off_y - yDst;
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
- xSrc = xSrc + src_off_x - xDst - dst_off_x;
- ySrc = ySrc + src_off_y - yDst - dst_off_y;
-
while (nbox--) {
(*uxa_screen->info->composite) (pDstPix,
pbox->x1 + xSrc,
pbox->y1 + ySrc,
0, 0,
- pbox->x1,
- pbox->y1,
+ pbox->x1 + dst_off_x,
+ pbox->y1 + dst_off_y,
pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1);
pbox++;
@@ -1221,8 +1219,6 @@ uxa_try_driver_composite(CARD8 op,
}
}
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
-
if (!(*uxa_screen->info->prepare_composite)
(op, localSrc, localMask, pDst, pSrcPix, pMaskPix, pDstPix)) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
@@ -1235,25 +1231,24 @@ uxa_try_driver_composite(CARD8 op,
return -1;
}
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
-
if (pMask) {
- xMask = xMask + mask_off_x - xDst - dst_off_x;
- yMask = yMask + mask_off_y - yDst - dst_off_y;
+ xMask = xMask + mask_off_x - xDst;
+ yMask = yMask + mask_off_y - yDst;
}
- xSrc = xSrc + src_off_x - xDst - dst_off_x;
- ySrc = ySrc + src_off_y - yDst - dst_off_y;
+ xSrc = xSrc + src_off_x - xDst;
+ ySrc = ySrc + src_off_y - yDst;
+ nbox = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
while (nbox--) {
(*uxa_screen->info->composite) (pDstPix,
pbox->x1 + xSrc,
pbox->y1 + ySrc,
pbox->x1 + xMask,
pbox->y1 + yMask,
- pbox->x1,
- pbox->y1,
+ pbox->x1 + dst_off_x,
+ pbox->y1 + dst_off_y,
pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1);
pbox++;