summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-29 03:49:56 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-29 03:51:01 +0000
commit9b92625151ca75a6ee10f231f83b53f67a371947 (patch)
treeee70936c3480eba04467f31ca827f5e94825bea3
parentc006b886d28a772d7a62cec52ab7e0c8196c36f6 (diff)
xlib/shm: Simplify uploading of SHM image data
Make sure that we simply copy from the SHM segment into the target drawable, and not inadvertently stage it through another SHM buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-xlib-render-compositor.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c
index 10360dbe..e3ea3f00 100644
--- a/src/cairo-xlib-render-compositor.c
+++ b/src/cairo-xlib-render-compositor.c
@@ -250,15 +250,16 @@ draw_image_boxes (void *_dst,
cairo_int_status_t status;
int i;
- if (image->base.device == dst->base.device &&
- image->depth != dst->depth)
- return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (image->base.device == dst->base.device) {
+ if (image->depth != dst->depth)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
- if (image->base.device == dst->base.device &&
- image->depth == dst->depth &&
- _cairo_xlib_shm_surface_get_pixmap (&image->base))
+ if (_cairo_xlib_shm_surface_get_pixmap (&image->base))
return copy_image_boxes (dst, image, boxes, dx, dy);
+ goto draw_image_boxes;
+ }
+
shm = NULL;
if (boxes_cover_surface (boxes, dst))
shm = (cairo_image_surface_t *) _cairo_xlib_surface_get_shm (dst, TRUE);
@@ -356,6 +357,7 @@ draw_image_boxes (void *_dst,
}
}
+draw_image_boxes:
status = CAIRO_STATUS_SUCCESS;
for (chunk = &boxes->chunks; chunk; chunk = chunk->next) {
for (i = 0; i < chunk->count; i++) {
@@ -364,10 +366,10 @@ draw_image_boxes (void *_dst,
int y1 = _cairo_fixed_integer_part (b->p1.y);
int x2 = _cairo_fixed_integer_part (b->p2.x);
int y2 = _cairo_fixed_integer_part (b->p2.y);
- if ( _cairo_xlib_surface_draw_image (dst, image,
- x1 + dx, y1 + dy,
- x2 - x1, y2 - y1,
- x1, y1)) {
+ if (_cairo_xlib_surface_draw_image (dst, image,
+ x1 + dx, y1 + dy,
+ x2 - x1, y2 - y1,
+ x1, y1)) {
status = CAIRO_INT_STATUS_UNSUPPORTED;
goto out;
}