From 14e0d3d3a42deac41aff72f8a6aa032ba55c54ea Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 24 Mar 2010 14:50:45 +0000 Subject: [PATCH 2/3] uxa: Only reduce a composite to a BLT if it is wholly contained Signed-off-by: Chris Wilson --- uxa/uxa-render.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c index ca46a2a..bcfe20e 100644 --- a/uxa/uxa-render.c +++ b/uxa/uxa-render.c @@ -977,6 +977,21 @@ compatible_formats (CARD8 op, PicturePtr dst, PicturePtr src) return 0; } +static int +drawable_contains (DrawablePtr drawable, int x1, int y1, int x2, int y2) +{ + if (x1 < 0 || y1 < 0) + return FALSE; + + if (x2 > drawable->width) + return FALSE; + + if (y2 > drawable->height) + return FALSE; + + return TRUE; +} + void uxa_composite(CARD8 op, PicturePtr pSrc, @@ -1026,7 +1041,8 @@ uxa_composite(CARD8 op, width, height); if (ret == 1) goto done; - } else if (!pSrc->repeat && !pSrc->transform) { + } else if (!pSrc->repeat && !pSrc->transform && + drawable_contains(pSrc->pDrawable, xSrc, ySrc, xSrc + width, ySrc + height)) { xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; -- 1.7.0.3