[cairo] New API proposal: cairo_restore_status()

Bill Spitzak spitzak at gmail.com
Wed Jan 12 12:53:25 PST 2011



Benjamin Otte wrote:

> The biggest use case is "user-generated" code that should not mess up
> the whole graphics rendering.
> The best example here is webkit-gtk and Swfdec (and I suspect Mozilla,
> too, unless you do lots of error checking) where SVG or SWF files are
> able to cairo_transform() with degenerate (or multiple
> almost-degenerate) matrices that cause a CAIRO_STATUS_INVALID_MATRIX.
> That's only really be avoidable by carefully checking matrices every
> time before setting them.

Though I agree that this ability to clear an error is wanted, it would 
also help if these things were not errors in Cairo.

Degenerate matrix in most cases should cause nothing to be drawn. If 
pen-width locking is implemented then any path that is stroked should be 
treated as either a single line segment or a point.

Requesting the bounding box or other dimension of something while a 
degenerate matrix is the CTM might still produce an error, but even then 
I suspect it would be ok if it returned an empty box and no error.



More information about the cairo mailing list