[Cairo] Rectangle-based clipping for surfaces

Bill Spitzak spitzak at d2.com
Wed Oct 15 11:47:41 PDT 2003


On Wednesday 15 October 2003 09:35 am, Carl Worth wrote:

> The only thing left that I dislike is that in the path-based clipping
> API, cairo_clip always reduces the size of the clip region. However,
> in the rectangle-based API, cairo_surface_clip_rectangle always
> expands the size of its region. Maybe we could find a better name for
> cairo_surface_clip_rectangle that more clearly indicates the operation
> we want?

My personal feeling is that the only way to increase the clip region should 
be a cairo_restore call. Can you instead use a single call that takes a list 
of rectangles? Then that call can union the rectangles and then intersect 
with the current clip.

Also I remember it was planned to add an efficient way to add rectangles to 
the current path. Then if you clipped to the current path this could be 
detected and also produce the same efficient result as above.

If you do want this call I would certainly rename it. I would expect anything 
called "clip_rectangle" to intersect the clip with the rectangle. Perhaps the 
call should be "unclip_rectangle".

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com




More information about the cairo mailing list