summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-pdf-surface.c')
-rw-r--r--src/cairo-pdf-surface.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index ca3a4d237..dd5f68c19 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -5793,22 +5793,13 @@ _cairo_pdf_surface_set_clip (cairo_pdf_surface_t *surface,
{
cairo_clip_t *clip = composite->clip;
- if (_cairo_clip_is_region (clip) &&
- cairo_region_contains_rectangle (_cairo_clip_get_region (clip),
- &composite->unbounded) == CAIRO_REGION_OVERLAP_IN)
- {
- clip = NULL;
- }
+ if (_cairo_composite_rectangles_can_reduce_clip (composite, clip))
+ 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)
- {
+ if (_cairo_composite_rectangles_can_reduce_clip (composite,
+ surface->clipper.clip))
return CAIRO_STATUS_SUCCESS;
- }
}
return _cairo_surface_clipper_set_clip (&surface->clipper, clip);