[cairo-commit] src/cairo-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Dec 15 07:39:03 PST 2010


 src/cairo-surface.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 10e58a4a1638a67da132f3bc3f4ebdbc36691b13
Author: Uli Schlachter <psychon at znc.in>
Date:   Wed Nov 17 18:25:27 2010 +0100

    Avoid some unneeded 'is_clear = FALSE'
    
    When a drawing operator doesn't actually have any effect, we don't have to set
    the surface's is_clear flag to FALSE.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 8b95741..01ea27a 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -2024,7 +2024,8 @@ _cairo_surface_paint (cairo_surface_t	*surface,
     status = _cairo_surface_fallback_paint (surface, op, source, clip);
 
  FINISH:
-    surface->is_clear = op == CAIRO_OPERATOR_CLEAR && clip == NULL;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = op == CAIRO_OPERATOR_CLEAR && clip == NULL;
 
     return _cairo_surface_set_error (surface, status);
 }
@@ -2079,7 +2080,8 @@ _cairo_surface_mask (cairo_surface_t		*surface,
     status = _cairo_surface_fallback_mask (surface, op, source, mask, clip);
 
  FINISH:
-    surface->is_clear = FALSE;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
 }
@@ -2158,7 +2160,8 @@ _cairo_surface_fill_stroke (cairo_surface_t	    *surface,
 	goto FINISH;
 
   FINISH:
-    surface->is_clear = FALSE;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
 }
@@ -2216,7 +2219,8 @@ _cairo_surface_stroke (cairo_surface_t		*surface,
 					     clip);
 
  FINISH:
-    surface->is_clear = FALSE;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
 }
@@ -2270,7 +2274,8 @@ _cairo_surface_fill (cairo_surface_t	*surface,
 					   clip);
 
  FINISH:
-    surface->is_clear = FALSE;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
 }
@@ -2674,7 +2679,8 @@ _cairo_surface_show_text_glyphs (cairo_surface_t	    *surface,
     if (dev_scaled_font != scaled_font)
 	cairo_scaled_font_destroy (dev_scaled_font);
 
-    surface->is_clear = FALSE;
+    if (status != CAIRO_INT_STATUS_NOTHING_TO_DO)
+	surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
 }


More information about the cairo-commit mailing list