diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-10 19:25:14 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-10 19:25:14 +0100 |
commit | b495e7eb2ee2521a400d4b42e04242023bdb1e44 (patch) | |
tree | 943b5611e655d09164ecd936a504384c726302c4 | |
parent | 94aeae9b2ec563201a0e65705504d1d70c33a619 (diff) |
[surface] Early return for (region IN white)
Fill a region using IN and a white source is a frequent reduction of a
complex clip (viz a path that covers the whole operation extents will be
reduced to a single rectangle), and we can simply discard the fill (as it
always has bounded semantics).
-rw-r--r-- | src/cairo-surface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 6dab8e22..25ce0b92 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1846,6 +1846,13 @@ _cairo_surface_fill_region (cairo_surface_t *surface, if (num_rects == 0) return CAIRO_STATUS_SUCCESS; + /* catch a common reduction of _cairo_clip_combine_with_surface() */ + if (op == CAIRO_OPERATOR_IN && + _cairo_color_equal (color, CAIRO_COLOR_WHITE)) + { + return CAIRO_STATUS_SUCCESS; + } + if (num_rects > ARRAY_LENGTH (stack_rects)) { rects = _cairo_malloc_ab (num_rects, sizeof (cairo_rectangle_int_t)); |