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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-25 01:31:34 +00:00
parent ae6d3a3117
commit 46252bc7bc
1 changed files with 2 additions and 2 deletions

View File

@ -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;