[cairo] Re: New API: cairo_xlib_surface_get_*

Bill Spitzak spitzak at d2.com
Thu May 4 14:07:37 PDT 2006


> On Thu, 23 Feb 2006 16:39:14 +1300, Robert O'Callahan wrote:

>> -- Added cairo_extract_clip_rectangles to obtain the current clip in
>> device coordinates. If the clip cannot be expressed as rectangles, the
>> function simply gives up ... for our purposes, a non-rectangular clip is
>> useless anyway.
>> Patches for these extensions are attached --- please evaluate.

Though I'm not sure what you are using this for, I think I did something 
like this before, but it really helped if the function took a rectangle 
as input, and does what is described above for the *intersection* of the 
clip with this rectangle. This avoids wasting time calculating parts of 
the clip path that are outside the area you intend to draw anyway.

Rather than "give up" a reasonable fallback might be to intersect the 
path with the rectangle and return the bounding box of the resulting 
shape. In fact this could be your initial implementation.



More information about the cairo mailing list