summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@fishsoup.net>2008-06-24 12:40:47 -0400
committerAdam Jackson <ajax@redhat.com>2008-06-24 12:42:38 -0400
commit3dfe90fe6c325a7a40ee6c613be444d4b8e32971 (patch)
treea79d59323c464ad475359d6c0a38e6cbc532f18b /render
parent3a7657b7131c16682c34dfc739c430b36fb3d4db (diff)
Bug #15369: Don't reduce Over to Src for transform + RepeatNone.
Only do no-src-alpha optimizations for a RepeatNone source if we can easily probe that we won't sample outside the edges of the source. (cherry picked from commit 574c62e305e5380bb1b0f4bfec4f7cc3e3f03ada)
Diffstat (limited to 'render')
-rw-r--r--render/picture.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/render/picture.c b/render/picture.c
index 2fbd09e8b..b7874bb64 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1548,12 +1548,24 @@ FreePictFormat (pointer pPictFormat,
* being careful to avoid these cases.
*/
static CARD8
-ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst)
+ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
+ INT16 xSrc, INT16 ySrc, CARD16 width, CARD16 height)
{
Bool no_src_alpha, no_dst_alpha;
+ /* Sampling off the edge of a RepeatNone picture introduces alpha
+ * even if the picture itself doesn't have alpha. We don't try to
+ * detect every case where we don't sample off the edge, just the
+ * simplest case where there is no transform on the source
+ * picture.
+ */
no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) &&
PICT_FORMAT_A(pSrc->format) == 0 &&
+ (pSrc->repeatType != RepeatNone ||
+ (!pSrc->transform &&
+ xSrc >= 0 && ySrc >= 0 &&
+ xSrc + width <= pSrc->pDrawable->width &&
+ ySrc + height <= pSrc->pDrawable->height)) &&
pSrc->alphaMap == NULL &&
pMask == NULL;
no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) &&
@@ -1655,7 +1667,7 @@ CompositePicture (CARD8 op,
ValidatePicture (pMask);
ValidatePicture (pDst);
- op = ReduceCompositeOp (op, pSrc, pMask, pDst);
+ op = ReduceCompositeOp (op, pSrc, pMask, pDst, xSrc, ySrc, width, height);
if (op == PictOpDst)
return;