[cairo-commit] src/cairo-xlib-render-compositor.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jan 28 19:53:20 PST 2013


 src/cairo-xlib-render-compositor.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 9b92625151ca75a6ee10f231f83b53f67a371947
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jan 29 03:49:56 2013 +0000

    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 at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c
index 10360db..e3ea3f0 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;
 	    }


More information about the cairo-commit mailing list