summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-08-16 10:21:49 +0100
committerDave Airlie <airlied@redhat.com>2011-08-16 10:21:49 +0100
commitcfc66e76815f193355b1fa003768309b7b65cbaa (patch)
treef9b2ef8cc73c670614b5e29bca42bfaf7c0ce0a8
parent19780f6ca61f045bd7b9cd9433e4788de5b10701 (diff)
fixes for composite to shattered pixmaps
-rw-r--r--drv/impedpict.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drv/impedpict.c b/drv/impedpict.c
index f2e0a2385..639033b64 100644
--- a/drv/impedpict.c
+++ b/drv/impedpict.c
@@ -15,6 +15,22 @@
#include "drv_pixmapstr.h"
#include "drv_picturestr.h"
+static void setup_shatter_clip(RegionPtr orig_region, DrvPicturePtr pDrvPicture)
+{
+ RegionRec pixclip;
+
+ /* adjust the composite clip */
+ DrvPixmapRegionInit(&pixclip, pDrvPicture->pPixmap);
+
+ RegionNull(orig_region);
+ RegionCopy(orig_region, pDrvPicture->pCompositeClip);
+ RegionIntersect(pDrvPicture->pCompositeClip, orig_region, &pixclip);
+}
+
+static void finish_shatter_clip(RegionPtr orig_region, DrvPicturePtr pDrvPicture)
+{
+ RegionCopy(pDrvPicture->pCompositeClip, orig_region);
+}
static void SyncDrvPicture(PicturePtr pPicture, DrvPicturePtr pDrvPicture,
int index)
@@ -157,6 +173,7 @@ impedComposite (CARD8 op,
for (i = 0; i < imped_screen->num_gpu; i++) {
DrvPictureScreenPtr drv_ps;
+ RegionRec orig_src_region, orig_mask_region, orig_dst_region;
pDrvSrc = imped_src->gpu[i];
SyncDrvPicture(pSrc, pDrvSrc, i);
@@ -173,10 +190,24 @@ impedComposite (CARD8 op,
pDrvMask->pPixmap = imped_mask_pixmap->gpu[i];
pDrvDst->pPixmap = imped_dst_pixmap->gpu[i];
+ if (pSrcPixmap && imped_src_pixmap->shattered)
+ setup_shatter_clip(&orig_src_region, pDrvSrc);
+ if (pDrvMask && imped_mask_pixmap->shattered)
+ setup_shatter_clip(&orig_mask_region, pDrvMask);
+ if (imped_dst_pixmap->shattered)
+ setup_shatter_clip(&orig_dst_region, pDrvDst);
+
drv_ps = DrvGetPictureScreen(imped_screen->gpu[i]);
drv_ps->Composite(op, pDrvSrc, pDrvMask, pDrvDst,
xSrc, ySrc, xMask, yMask,
xDst, yDst, width, height);
+
+ if (imped_dst_pixmap->shattered)
+ finish_shatter_clip(&orig_dst_region, pDrvDst);
+ if (pDrvMask && imped_mask_pixmap->shattered)
+ finish_shatter_clip(&orig_mask_region, pDrvMask);
+ if (pSrcPixmap && imped_src_pixmap->shattered)
+ finish_shatter_clip(&orig_src_region, pDrvSrc);
}
}
@@ -351,7 +382,7 @@ impedTriangles (CARD8 op,
imped_dst = impedGetPict(pDst);
pDstPixmap = GetDrawablePixmap(pDst->pDrawable);
imped_dst_pixmap = impedGetPixmap(pDstPixmap);
- impedGetDrawableDeltas(pSrc->pDrawable, pSrcPixmap, &x_off, &y_off);
+ impedGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &x_off, &y_off);
if (x_off || y_off) {
for (i = 0; i < ntris; i++) {
tris[i].p1.x += x_off << 16;