From b495e7eb2ee2521a400d4b42e04242023bdb1e44 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 10 Sep 2009 19:25:14 +0100 Subject: [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). --- src/cairo-surface.c | 7 +++++++ 1 file changed, 7 insertions(+) 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)); -- cgit v1.2.3