From a89218d684e112e10ff337276b448acb0267c53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 25 Mar 2011 11:43:38 +0100 Subject: [PATCH] EXA: Avoid GPU memory readback for PolyGlyphBlt fallbacks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://bugs.freedesktop.org/show_bug.cgi?id=30679 . Signed-off-by: Michel Dänzer --- exa/exa_unaccel.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 7e4499e..903e1fc 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -345,10 +345,19 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase) { + PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + ExaPixmapPriv(pPixmap); + EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable, exaDrawableLocation(pDrawable), pGC->fillStyle, pGC->alu)); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + if (!pExaScr->prepare_access_reg || !pExaPixmap->pDamage || + exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu, pGC->clientClipType)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, + DamagePendingRegion(pExaPixmap->pDamage)); exaPrepareAccessGC (pGC); pGC->ops->PolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); exaFinishAccessGC (pGC); -- 1.7.4.1