[cairo] New API proposal: cairo_restore_status()

Andrea Canciani ranma42 at gmail.com
Tue Jan 11 12:57:01 PST 2011


On Tue, Jan 11, 2011 at 9:07 PM, Jeff Muizelaar <jeff at infidigm.net> wrote:
> On 11/01/11 6:33 AM, Andrea Canciani wrote:
>>
>> A discussion on IRC pointed out the usefulness of some way to reset
>> the error status of a cairo_t.
>
> I have two questions:
> 1. What about situations where the errors are not recoverable?

The operation is defined to always restore the previous situation, no
matter what the error is. I'm not sure about what you mean with
"not recoverable". cairo_t objects are basically a stack of states. Even
if you broke the state on the top of the stack, those under it will
still be valid. As long as no operation damages what is under the top
of the stack, this is possible and easy.

> 2. What was the use case from Benjamin?

Benjamin might provide further detail, but from what I understood
in IRC, it seems like GTK+ and/or webkit-gtk+ are sometimes
breaking their cairo_t objects by setting invalid matrices (and probably
other invalid settings) in subfunctions. The "master" function
wants to be able to recover and continue drawing even if one
of the subfunctions got stuck because of an error status.

Andrea


More information about the cairo mailing list