diff options
-rw-r--r-- | src/sna/sna_blt.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index dfc4b434..64fcd061 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -1595,6 +1595,24 @@ sna_blt_composite(struct sna *sna, return FALSE; } + if (!sna_transform_is_integer_translation(src->transform, &tx, &ty)) { + DBG(("%s: source transform is not an integer translation\n", + __FUNCTION__)); + return FALSE; + } + x += tx; + y += ty; + + if ((x > src->pDrawable->width || + y > src->pDrawable->height || + x + width < 0 || + y + height < 0) && + (!src->repeat || src->repeatType == RepeatNone)) { + DBG(("%s: source is outside of valid area, converting to clear\n", + __FUNCTION__)); + return prepare_blt_clear(sna, tmp); + } + alpha_fixup = 0; if (!(dst->format == src_format || dst->format == alphaless(src_format) || @@ -1607,14 +1625,6 @@ sna_blt_composite(struct sna *sna, return FALSE; } - if (!sna_transform_is_integer_translation(src->transform, &tx, &ty)) { - DBG(("%s: source transform is not an integer translation\n", - __FUNCTION__)); - return FALSE; - } - x += tx; - y += ty; - /* XXX tiling? */ if (x < 0 || y < 0 || x + width > src->pDrawable->width || |