diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c index 5c46ec9..6c75c82 100644 --- a/exa/exa_glyphs.c +++ b/exa/exa_glyphs.c @@ -701,6 +701,8 @@ exaGlyphs (CARD8 op, GlyphListPtr list, GlyphPtr *glyphs) { + PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable); + ExaPixmapPrivPtr pDstExaPix = ExaGetPixmapPriv(pDstPixmap); PixmapPtr pMaskPixmap = 0; PicturePtr pMask = NULL; ScreenPtr pScreen = pDst->pDrawable->pScreen; @@ -713,6 +715,30 @@ exaGlyphs (CARD8 op, BoxRec extents = {0, 0, 0, 0}; CARD32 component_alpha; ExaGlyphBuffer buffer; + RegionRec region; + + if (pDstExaPix->pDamage) + extents = *RegionExtents(DamagePendingRegion(pDstExaPix->pDamage)); + else + GlyphExtents (nlist, list, glyphs, &extents); + + width = extents.x2 - extents.x1; + height = extents.y2 - extents.y1; + if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1 || + !miComputeCompositeRegion (®ion, pSrc, NULL, pDst, xSrc, ySrc, 0, 0, + extents.x1, extents.y1, width, height)) { + if (pDstExaPix->pDamage) + RegionEmpty(DamagePendingRegion(pDstExaPix->pDamage)); + return; + } + + if (pDstExaPix->pDamage) { + RegionPtr pRegion = DamagePendingRegion(pDstExaPix->pDamage); + RegionUnion(pRegion, ®ion, pRegion); + } + + extents = *RegionExtents(®ion); + RegionUninit(®ion); if (maskFormat) { @@ -720,10 +746,6 @@ exaGlyphs (CARD8 op, GCPtr pGC; xRectangle rect; - GlyphExtents (nlist, list, glyphs, &extents); - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; width = extents.x2 - extents.x1; height = extents.y2 - extents.y1; diff --git a/exa/exa_render.c b/exa/exa_render.c index 3974afe..9bdd7d0 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -897,11 +897,27 @@ exaComposite(CARD8 op, CARD16 height) { ExaScreenPriv (pDst->pDrawable->pScreen); + PixmapPtr pDstPix = exaGetDrawablePixmap(pDst->pDrawable); + ExaPixmapPrivPtr pDstExaPix = ExaGetPixmapPriv(pDstPix); int ret = -1; Bool saveSrcRepeat = pSrc->repeat; Bool saveMaskRepeat = pMask ? pMask->repeat : 0; RegionRec region; + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, xDst, yDst, + width, height)) { + if (pDstExaPix->pDamage) + RegionEmpty(DamagePendingRegion(pDstExaPix->pDamage)); + return; + } + + if (pDstExaPix->pDamage) { + RegionPtr pRegion = DamagePendingRegion(pDstExaPix->pDamage); + RegionUnion(pRegion, ®ion, pRegion); + RegionUninit(®ion); + } + if (pExaScr->swappedOut) goto fallback;