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>
This commit is contained in:
parent
2adf823b80
commit
c2abf8d659
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue