diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-30 12:40:41 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-30 12:40:41 +0000 |
commit | 66625cb46c985321c46b79d2163a4d676d6700ba (patch) | |
tree | 38c4bfb4387211937663b386c15d07cb2a1f7757 /src/cairo-xlib-render-compositor.c | |
parent | 65176b7380f0d633da514be1febe16f17b99d876 (diff) | |
download | cairo-66625cb46c985321c46b79d2163a4d676d6700ba.tar.gz |
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 c068691ff57c2f6cd750a54db17393c0e132cb00
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>
Diffstat (limited to 'src/cairo-xlib-render-compositor.c')
-rw-r--r-- | src/cairo-xlib-render-compositor.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c index e32538285..74c43e99f 100644 --- a/src/cairo-xlib-render-compositor.c +++ b/src/cairo-xlib-render-compositor.c @@ -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; } } } |