summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-07-21 16:08:44 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-07-23 12:23:31 +0100
commitc88b6a922260615e093504af2db40c8ee17b6150 (patch)
tree91a912d33af66dc437a7d0d304afcc92e095a267
parentab0c6f1ac957d1631cd33ed63e46f76978bd8a1c (diff)
downloadxf86-video-armada-c88b6a922260615e093504af2db40c8ee17b6150.tar.gz
Clean up vivante_accel_Composite() a little
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_accel.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index e5e7330..9c55a9d 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -1338,9 +1338,9 @@ int vivante_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
{
- struct vivante *vivante = vivante_get_screen_priv(pDst->pDrawable->pScreen);
- struct vivante_pixmap *vDst, *vSrc, *vMask, *vTemp = NULL;
ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ struct vivante *vivante = vivante_get_screen_priv(pScreen);
+ struct vivante_pixmap *vDst, *vSrc, *vMask, *vTemp = NULL;
PixmapPtr pPixmap, pPixTemp = NULL;
RegionRec region;
gcsRECT clipTemp;
@@ -1351,7 +1351,7 @@ int vivante_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
return FALSE;
/* If there are alpha maps, fallback for now */
- if (pDst->alphaMap || pSrc->alphaMap)
+ if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap))
return FALSE;
/* If the source has no drawable, and is not solid, fallback */
@@ -1359,7 +1359,7 @@ int vivante_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
return FALSE;
if (pMask) {
- if (pMask->alphaMap || pMask->componentAlpha)
+ if (pMask->componentAlpha)
return FALSE;
if (!pMask->pDrawable)
@@ -1390,16 +1390,15 @@ fprintf(stderr, "%s: i: op 0x%02x src=%p,%d,%d mask=%p,%d,%d dst=%p,%d,%d %ux%u\
/* We don't handle mask repeats (yet) */
if (pMask->repeat != RepeatNone)
goto fallback;
- }
- /*
- * Convert the source/destination coordinates according to the
- * position of the drawables against the backing buffer.
- */
- if (pMask && pMask->pDrawable) {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
+ /* Include the mask drawable's position on the pixmap */
+ if (pMask->pDrawable) {
+ xMask += pMask->pDrawable->x;
+ yMask += pMask->pDrawable->y;
+ }
}
+
+ /* Include the destination drawable's position on the pixmap */
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;