From 46252bc7bcc7e08e47d00cdc87d6c1ed93830fcc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 25 Jan 2012 01:31:34 +0000 Subject: [PATCH] sna: Set the source clip for CopyArea fallback correctly The source window is (src->x, src->y)x(src->width, src->height) in pixmap space. However, we then need to use this to clip against the desination region, and so we need to translate from the source coordinate to the destination coordinate. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f86bb625..2d838689 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3629,8 +3629,8 @@ sna_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc, { RegionRec clip; - clip.extents.x1 = -(src_x - dst_x - dst->x + src->x); - clip.extents.y1 = -(src_y - dst_y - dst->y + src->y); + clip.extents.x1 = src->x - (src->x + src_x) + (dst->x + dst_x); + clip.extents.y1 = src->y - (src->y + src_y) + (dst->y + dst_y); clip.extents.x2 = clip.extents.x1 + src->width; clip.extents.y2 = clip.extents.y1 + src->height; clip.data = NULL;