From 1b2709d8c0933af254372c9b0d4fa5c011ef4586 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 15 Sep 2011 15:09:24 +0100 Subject: [PATCH] composite: Reduce an unaligned clip Signed-off-by: Chris Wilson --- src/cairo-composite-rectangles.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cairo-composite-rectangles.c b/src/cairo-composite-rectangles.c index a50a3474c..a6f37689a 100644 --- a/src/cairo-composite-rectangles.c +++ b/src/cairo-composite-rectangles.c @@ -371,20 +371,17 @@ _cairo_composite_rectangles_can_reduce_clip (cairo_composite_rectangles_t *compo cairo_clip_t *clip) { cairo_rectangle_int_t extents; + cairo_box_t box; if (clip == NULL) return TRUE; - /* XXX In the not a region case, we could still search through the boxes */ - if (! _cairo_clip_is_region (clip)) - return FALSE; - extents = composite->destination; if (composite->is_bounded & CAIRO_OPERATOR_BOUND_BY_SOURCE) _cairo_rectangle_intersect (&extents, &composite->source); if (composite->is_bounded & CAIRO_OPERATOR_BOUND_BY_MASK) _cairo_rectangle_intersect (&extents, &composite->mask); - return cairo_region_contains_rectangle (_cairo_clip_get_region (clip), - &extents) == CAIRO_REGION_OVERLAP_IN; + _cairo_box_from_rectangle (&box, &extents); + return _cairo_clip_contains_box (clip, &box); }