summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-29 13:06:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-29 13:06:49 +0100
commitccf67c7d748aa10005fb47b4d565c34e41c1a327 (patch)
tree05899f79f055c5580741e625b62e3757a619885a /src/cairo-pdf-surface.c
parent6ed0c6224b763e9cbcfb0d46f188883d8425bab5 (diff)
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>
Diffstat (limited to 'src/cairo-pdf-surface.c')
-rw-r--r--src/cairo-pdf-surface.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 1e6b22c7..d6f382bb 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -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);
}