diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-24 14:50:45 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-24 16:42:05 +0000 |
commit | 90a971c60769781f53827b469a9be3aab14cf71c (patch) | |
tree | abb4595360bf2ab1babc4b1382ced37709a8cd0c /uxa/uxa-render.c | |
parent | 2eec53d0b9232970fe3d03ce6c8940ebeea44bee (diff) |
uxa: Only reduce a composite to a BLT if it is wholly contained
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa/uxa-render.c')
-rw-r--r-- | 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 ca46a2a9..bcfe20eb 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; |