[cairo] [RFC] Add device_extents api

Jeff Muizelaar jeff at infidigm.net
Tue Feb 3 09:35:38 PST 2009

The current cairo_(stroke|fill|path)_extents api does not do what users want or
expect. Here's some of the evidence of this:

Currently, the stroke/fill/path extents functions compute the device space axis
aligned bounding box, transform the bounding box back to user space and compute
the user space axis aligned bounding box of that. In contrast, glyph_extents()
computes the extents directly in userspace and should give expected results.

An example of this is at http://people.mozilla.com/~jmuizelaar/extents.png. In
this example, the yellow line is the path we compute the extents for. The green
box is the what you'd probably expect as user space extents. The red box is
what you'd expect for device space extents and the blue box is the extents that
we return. I'm not really sure what use the blue box, perhaps someone can come up
with a use case?  Interestingly enough, the quartz
CGContextGetPathBoundingBox() function returns the same 'weird' extents that we

More information about the cairo mailing list