[cairo] obtaining last operation extents

Vladimir Vukicevic vladimir at pobox.com
Mon Mar 30 21:28:48 PDT 2009

A thought... It's fairly common to call cairo_fill_extents() then 
cairo_fill(), or cairo_stroke_extents() then cairo_stroke().  Computing 
the extents is often cheaper than doing the full operation, but are the 
extents available "for free" during setup for the operation?  If so, 
would it be possible to provide a cairo_last_operation_extents() that 
would just return a precomputed & cached rect?

Though now that I think about it, backends that implement, say, 
fill()/stroke() aren't going to go through cairo's tessellation, so 
calculating the extents would require having the path still around... 
and fill/stroke consume the path.  Hrm.  So if this is possible, a less 
ugly solution might be some functions to both perform the operation and 
obtain the extents in one go.  (cairo_fill_with_extents() or something?)

     - Vlad

More information about the cairo mailing list