[cairo-commit] 3 commits - src/cairo.c src/cairo-surface-fallback.c

Chris Wilson ickle at kemper.freedesktop.org
Wed May 9 18:38:53 EEST 2007


 src/cairo-surface-fallback.c |   28 ++++++++++++++--------------
 src/cairo.c                  |   10 ++++++----
 2 files changed, 20 insertions(+), 18 deletions(-)

New commits:
diff-tree b5d25068796d572b4b0c6e33eecc5f0736fb8f78 (from 6f09e93ad7ac4c941ba6c72b21ea4536d248f8d5)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed May 9 16:27:42 2007 +0100

    [cairo] cairo_pop_group() returns a NULL pattern
    
    cairo_pop_group() checks for a NULL return from
    cairo_pattern_create_for_surface() instead of the nil cairo_pattern_t,
    and then returns a NULL pattern instead of the nil object.

diff --git a/src/cairo.c b/src/cairo.c
index 443e9e0..10fb0a8 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -564,7 +564,7 @@ cairo_pop_group (cairo_t *cr)
     /* Verify that we are at the right nesting level */
     if (parent_target == NULL) {
 	_cairo_set_error (cr, CAIRO_STATUS_INVALID_POP_GROUP);
-	return NULL;
+	return (cairo_pattern_t*) &_cairo_pattern_nil.base;
     }
 
     /* We need to save group_surface before we restore; we don't need
@@ -578,8 +578,8 @@ cairo_pop_group (cairo_t *cr)
 	goto done;
 
     group_pattern = cairo_pattern_create_for_surface (group_surface);
-    if (!group_pattern) {
-	_cairo_set_error (cr, CAIRO_STATUS_NO_MEMORY);
+    if (cairo_pattern_status (group_pattern)) {
+	_cairo_set_error (cr, cairo_pattern_status (group_pattern));
         goto done;
     }
 
diff-tree 6f09e93ad7ac4c941ba6c72b21ea4536d248f8d5 (from ae5d4a1c17a46c0a6ea2e4c825ecce7a5cbbe28b)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed May 9 13:39:08 2007 +0100

    [ciro-surface-fallback] Propagate status for _clip_and_composite_trapezoids
    
    The result of _clip_and_composite_trapezoids() was ignored by 2/3 of
    its callers - simply propagate the status.

diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index cfdff2c..8898aee 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -709,16 +709,16 @@ _cairo_surface_fallback_paint (cairo_sur
     if (status)
 	return status;
 
-    _clip_and_composite_trapezoids (source,
-				    op,
-				    surface,
-				    &traps,
-				    surface->clip,
-				    CAIRO_ANTIALIAS_NONE);
+    status = _clip_and_composite_trapezoids (source,
+				             op,
+					     surface,
+					     &traps,
+					     surface->clip,
+					     CAIRO_ANTIALIAS_NONE);
 
     _cairo_traps_fini (&traps);
 
-    return CAIRO_STATUS_SUCCESS;
+    return status;
 }
 
 static cairo_status_t
@@ -843,16 +843,16 @@ _cairo_surface_fallback_stroke (cairo_su
 	return status;
     }
 
-    _clip_and_composite_trapezoids (source,
-				    op,
-				    surface,
-				    &traps,
-				    surface->clip,
-				    antialias);
+    status = _clip_and_composite_trapezoids (source,
+				             op,
+					     surface,
+					     &traps,
+					     surface->clip,
+					     antialias);
 
     _cairo_traps_fini (&traps);
 
-    return CAIRO_STATUS_SUCCESS;
+    return status;
 }
 
 cairo_status_t
diff-tree ae5d4a1c17a46c0a6ea2e4c825ecce7a5cbbe28b (from dfd4d41ac99dbe5d8ea16aa4ce4809b66308c803)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed May 9 13:19:54 2007 +0100

    [cairo] Return after detecting the invalid font-options.
    
    Do not continue to copy the contents of the nil cairo_font_options_t,
    but set the error on the context and return.

diff --git a/src/cairo.c b/src/cairo.c
index a77dfdd..443e9e0 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -2642,8 +2642,10 @@ cairo_set_font_options (cairo_t         
 	return;
 
     status = cairo_font_options_status ((cairo_font_options_t *) options);
-    if (status)
+    if (status) {
 	_cairo_set_error (cr, status);
+	return;
+    }
 
     _cairo_gstate_set_font_options (cr->gstate, options);
 }


More information about the cairo-commit mailing list