diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-19 16:18:40 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-24 09:40:28 +0100 |
commit | c2abf8d659b8b161a4f9df100b614ee3c8f8e458 (patch) | |
tree | 68407a97ae91f0e0c6fbf41ae2fd23f1bf8de2ec /uxa | |
parent | 2adf823b80b7b1f6df1bf3422a1219e93321a8fb (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>
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa-render.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index 68e36515..139d42e8 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -391,8 +391,6 @@ uxa_try_driver_solid_fill(PicturePtr pSrc, width, height)) return 1; - REGION_TRANSLATE(pScreen, ®ion, 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, ®ion); @@ -432,6 +430,8 @@ uxa_try_driver_solid_fill(PicturePtr pSrc, return -1; } + REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + nbox = REGION_NUM_RECTS(®ion); pbox = REGION_RECTS(®ion); @@ -1090,21 +1090,19 @@ uxa_try_driver_composite_rects(CARD8 op, rects->width, rects->height)) goto next_rect; - REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + xSrc = xSrc + src_off_x - xDst; + ySrc = ySrc + src_off_y - yDst; nbox = REGION_NUM_RECTS(®ion); pbox = REGION_RECTS(®ion); - 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++; @@ -1258,8 +1256,6 @@ uxa_try_driver_composite(CARD8 op, } } - REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); - if (!(*uxa_screen->info->prepare_composite) (op, localSrc, localMask, pDst, pSrcPix, pMaskPix, pDstPix)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); @@ -1272,25 +1268,24 @@ uxa_try_driver_composite(CARD8 op, return -1; } - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); - 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(®ion); + pbox = REGION_RECTS(®ion); 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++; |