diff options
author | Uli Schlachter <psychon@znc.in> | 2010-11-17 18:25:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-15 15:38:36 +0000 |
commit | 10e58a4a1638a67da132f3bc3f4ebdbc36691b13 (patch) | |
tree | ff7b9760c5ca2ee4352d7cc1f7c6d7a2ebe567b4 /src | |
parent | 2a632b1f54bfa2f6466860fcdd151cb6187128d2 (diff) | |
download | cairo-10e58a4a1638a67da132f3bc3f4ebdbc36691b13.tar.gz |
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@znc.in>
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-surface.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 8b957413d..01ea27a97 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); } |