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

Chris Wilson ickle at kemper.freedesktop.org
Tue Oct 30 05:48:09 PDT 2012


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

New commits:
commit 66625cb46c985321c46b79d2163a4d676d6700ba
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 30 12:40:41 2012 +0000

    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 at 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 at aol.com>
    Reported-by: Kalev Lember <kalevlember at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56547
    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 e325382..74c43e9 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;
 	    }
 	}
     }


More information about the cairo-commit mailing list