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); }