From 848b585a16ce69f3486de222c294f01fee2b3f9a Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Michel=20D=C3=A4nzer?= Date: Sun, 22 Feb 2009 16:29:18 +0100 Subject: EXA: Handle separate alpha maps in Composite fallback. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 . Signed-off-by: Michel Dänzer --- exa/exa.h | 4 ++++ exa/exa_unaccel.c | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/exa/exa.h b/exa/exa.h index 21a0f1a..8f5d49c 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -672,6 +672,10 @@ typedef struct _ExaDriver { * from. */ #define EXA_PREPARE_MASK 2 + + #define EXA_PREPARE_ALPHAMAP_DEST 3 + #define EXA_PREPARE_ALPHAMAP_SRC 4 + #define EXA_PREPARE_ALPHAMAP_MASK 5 /** @} */ /** diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index c821f0d..4530e15 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -387,6 +387,7 @@ ExaCheckComposite (CARD8 op, PictureScreenPtr ps = GetPictureScreen(pScreen); #endif /* RENDER */ ExaScreenPriv(pScreen); + ExaPixmapPrivPtr pExaDstAlphaPix = NULL, pExaMaskAlphaPix = NULL, pExaSrcAlphaPix = NULL; RegionRec region; int xoff, yoff; @@ -408,13 +409,29 @@ ExaCheckComposite (CARD8 op, } else exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + if (pDst->alphaMap && pDst->alphaMap->pDrawable) { + pExaDstAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pDst->alphaMap->pDrawable)); + exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_DEST); + } + EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); if (pSrc->pDrawable != NULL) exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC); + if (pSrc->alphaMap && pSrc->alphaMap->pDrawable) { + pExaSrcAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pSrc->alphaMap->pDrawable)); + exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_SRC); + } if (pMask && pMask->pDrawable != NULL) exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK); + if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable) { + pExaMaskAlphaPix = + ExaGetPixmapPriv(exaGetDrawablePixmap(pMask->alphaMap->pDrawable)); + exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_MASK); + } #ifdef RENDER swap(pExaScr, ps, Composite); ps->Composite (op, @@ -433,9 +450,15 @@ ExaCheckComposite (CARD8 op, #endif /* RENDER */ if (pMask && pMask->pDrawable != NULL) exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK); + if (pExaMaskAlphaPix) + exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_MASK); if (pSrc->pDrawable != NULL) exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC); + if (pExaSrcAlphaPix) + exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_SRC); exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST); + if (pExaDstAlphaPix) + exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_ALPHAMAP_DEST); REGION_UNINIT(pScreen, ®ion); } -- 1.6.2.rc1