mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 23:00:09 +01:00
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:
parent
6ed0c6224b
commit
ccf67c7d74
1 changed files with 11 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue