mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 01:48:07 +02:00
xlib: Apply the image offsets to the destination rather the source
So that we can specify the entire source surface as the region to copy
and not introduce clipping errors.
Fixes regression from
commit c068691ff5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Aug 17 21:33:54 2012 +0100
xlib/shm: Use an impromptu upload ShmSegment
Reported-by: John Lindgren <john.lindgren@aol.com>
Reported-by: Kalev Lember <kalevlember@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56547
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
65176b7380
commit
66625cb46c
1 changed files with 10 additions and 12 deletions
|
|
@ -179,22 +179,19 @@ copy_image_boxes (void *_dst,
|
|||
int x2 = _cairo_fixed_integer_part (chunk->base[i].p2.x);
|
||||
int y2 = _cairo_fixed_integer_part (chunk->base[i].p2.y);
|
||||
|
||||
rects[j].x = x1;
|
||||
rects[j].y = y1;
|
||||
rects[j].width = x2 - x1;
|
||||
rects[j].height = y2 - y1;
|
||||
j++;
|
||||
if (x2 > x1 && y2 > y1) {
|
||||
rects[j].x = x1;
|
||||
rects[j].y = y1;
|
||||
rects[j].width = x2 - x1;
|
||||
rects[j].height = y2 - y1;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert (j == boxes->num_boxes);
|
||||
|
||||
XSetClipRectangles (dst->dpy, gc, 0, 0, rects, j, Unsorted);
|
||||
|
||||
XCopyArea (dst->dpy, src, dst->drawable, gc,
|
||||
dx, dy,
|
||||
image->width, image->height,
|
||||
0, 0);
|
||||
|
||||
0, 0, image->width, image->height, -dx, -dy);
|
||||
XSetClipMask (dst->dpy, gc, None);
|
||||
|
||||
if (rects != stack_rects)
|
||||
|
|
@ -337,7 +334,8 @@ draw_image_boxes (void *_dst,
|
|||
|
||||
if (_cairo_xlib_shm_surface_get_pixmap (&image->base)) {
|
||||
status = copy_image_boxes (dst, image, boxes, dx, dy);
|
||||
goto out;
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue