pdf: Don't remove the current clip if redundant

If the surface already has a clip set and that clip does not interfere
with the operation then we can leave it set.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-07-29 13:06:49 +01:00
parent 6ed0c6224b
commit ccf67c7d74

View file

@ -5756,6 +5756,17 @@ _cairo_pdf_surface_set_clip (cairo_pdf_surface_t *surface,
clip = NULL;
}
if (clip == NULL) {
cairo_clip_t *current = surface->clipper.clip;
if (current && _cairo_clip_is_region (current) &&
cairo_region_contains_rectangle (_cairo_clip_get_region (current),
&composite->unbounded) == CAIRO_REGION_OVERLAP_IN)
{
return CAIRO_STATUS_SUCCESS;
}
}
return _cairo_surface_clipper_set_clip (&surface->clipper, clip);
}