diff options
Diffstat (limited to 'exa/exa_accel.c')
-rw-r--r-- | exa/exa_accel.c | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 48af459a2..8ac21b8f8 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -144,7 +144,6 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, ExaScreenPriv (pDrawable->pScreen); PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); ExaPixmapPriv(pPix); - ExaMigrationRec pixmaps[1]; RegionPtr pClip; BoxPtr pbox; int nbox; @@ -166,11 +165,16 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, if (pExaScr->swappedOut) return FALSE; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = pPix; - pixmaps[0].pReg = DamagePendingRegion(pExaPixmap->pDamage); - exaDoMigration (pixmaps, 1, TRUE); + if (pExaPixmap->pDamage) { + ExaMigrationRec pixmaps[1]; + + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = pPix; + pixmaps[0].pReg = DamagePendingRegion(pExaPixmap->pDamage); + + exaDoMigration (pixmaps, 1, TRUE); + } pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); @@ -297,14 +301,19 @@ exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, .x2 = pDrawable->x + dx + sw, .y2 = pDrawable->y + dy + sh }; RegionRec region; int xoff, yoff; - RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + RegionPtr pending_damage = NULL; - REGION_INIT(pScreen, ®ion, &box, 1); + if (pExaPixmap->pDamage) + pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + if (pending_damage) { + REGION_INIT(pScreen, ®ion, &box, 1); - REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); - REGION_UNION(pScreen, pending_damage, pending_damage, ®ion); + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + + REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + REGION_UNION(pScreen, pending_damage, pending_damage, ®ion); + } if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)) { @@ -318,10 +327,12 @@ exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, exaFinishAccess(pDrawable, EXA_PREPARE_DEST); } - REGION_TRANSLATE(pScreen, ®ion, -xoff, -yoff); - DamageDamageRegion(pDrawable, ®ion); + if (pending_damage) { + REGION_TRANSLATE(pScreen, ®ion, -xoff, -yoff); + DamageDamageRegion(pDrawable, ®ion); - REGION_UNINIT(pScreen, ®ion); + REGION_UNINIT(pScreen, ®ion); + } } ShmFuncs exaShmFuncs = { NULL, exaShmPutImage }; @@ -968,16 +979,23 @@ exaImageGlyphBlt (DrawablePtr pDrawable, FbBits depthMask; PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); ExaPixmapPriv(pPixmap); - RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - BoxRec extents = *REGION_EXTENTS(pScreen, pending_damage); + RegionPtr pending_damage = NULL; + BoxRec extents; int xoff, yoff; - if (extents.x1 >= extents.x2 || extents.y1 >= extents.y2) - return; + if (pExaPixmap->pDamage) + pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - depthMask = FbFullMask(pDrawable->depth); + if (pending_damage) { + extents = *REGION_EXTENTS(pScreen, pending_damage); + + if (extents.x1 >= extents.x2 || extents.y1 >= extents.y2) + return; + + depthMask = FbFullMask(pDrawable->depth); + } - if ((pGC->planemask & depthMask) != depthMask) + if (!pending_damage || (pGC->planemask & depthMask) != depthMask) { ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); return; |