composite: Reduce an unaligned clip

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-15 15:09:24 +01:00
parent c0016e6ac9
commit 1b2709d8c0

View file

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