[cairo-commit] 2 commits - src/cairo-xlib-source.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Apr 6 01:32:06 PDT 2013


 src/cairo-xlib-source.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit a64ce09715162c57d6e4b6a460d426af1d443cdc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Apr 6 09:09:23 2013 +0100

    xlib: Trim uploads for surfaces extended by PAD
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index 5874f8d..746001e 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -986,6 +986,9 @@ surface_source (cairo_xlib_surface_t *dst,
 	if (pattern->base.extend == CAIRO_EXTEND_NONE) {
 	    if (! _cairo_rectangle_intersect (&upload, &limit))
 		return alpha_source (dst, 0);
+	} else if (pattern->base.extend == CAIRO_EXTEND_PAD) {
+	    if (! _cairo_rectangle_intersect (&upload, &limit))
+		upload = limit;
 	} else {
 	    if (upload.x < limit.x ||
 		upload.x + upload.width > limit.x + limit.width ||
commit 04b9d5d9b1ab8544fc0918d8ced90dc70641e727
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Apr 6 09:07:24 2013 +0100

    xlib: Wrap errors generating sources in an error surface
    
    Once upon a time the wrapping was provided by the caller, but the
    current requirement is that the error is propagated back as an error
    surface.
    
    Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=63196
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index 56dff65..5874f8d 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -294,7 +294,7 @@ render_pattern (cairo_xlib_surface_t *dst,
 					       extents->height);
     if (src->base.type != CAIRO_SURFACE_TYPE_XLIB) {
 	cairo_surface_destroy (&src->base);
-	return None;
+	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
     }
 
     map_extents = *extents;
@@ -1005,7 +1005,7 @@ surface_source (cairo_xlib_surface_t *dst,
     if (xsrc->base.type != CAIRO_SURFACE_TYPE_XLIB) {
 	cairo_surface_destroy (src);
 	cairo_surface_destroy (&xsrc->base);
-	return None;
+	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
     }
 
     if (_cairo_surface_is_image (src)) {


More information about the cairo-commit mailing list