cairo_copy_clip_rectangle_list(cairo_t*) returns the expected extents of the
target surface until a clip is applied. When the clip is applied it is not
intersected with the apparent existing clip (of the target extents) because
there is no clip recorded on the context, and cairo_copy_clip_rectangle_list
starts returning the applied clip (even when it is outside the target extents).
This looks like a regression from
where clips were disassociated from surfaces.
Before that _cairo_clip_clip would consider the target extents.
To be consistent with _cairo_gstate_clip_extents, the context's clip should be
intersected with the target surface extents (instead of only using them when
there is no clip).
Created attachment 37145 [details] [review]
consider gstate target extents in _cairo_gstate_copy_clip_rectangle_list
Intersecting the clip path with the target surface extents before getting the
region seems better than trying to get a region and then intersecting with the
target extents. With the later approach, some portion of the clip path beyond
the target could prevent successful generation of the region (or at least
cause unnecessary conversions to rectangles).
I could have left a fast path for unbounded clips but went with the
There was some inconsistency where lists with zero-rectangles were returned
both for empty clips and unbounded clips. The tests expect zero rectangles
for empty clips so unbounded clips (on infinite targets) now return
Author: Karl Tomlinson <email@example.com>
Date: Sat Jul 17 13:08:53 2010 +1200
clip: consider gstate target extents in _cairo_gstate_copy_clip_rectangle_list
To be consistent with _cairo_gstate_clip_extents, the context's clip
should be intersected with the target surface extents (instead of only
using them when there is no clip).
Reviewed-by: Chris Wilson <firstname.lastname@example.org>