[cairo] Idle thoughts on error propagation

Behdad Esfahbod behdad at behdad.org
Thu May 1 15:30:23 PDT 2008


On Thu, 2008-05-01 at 15:29 -0700, Vladimir Vukicevic wrote:
> 
> > My answer to that is "Yes.  A single error means that the surface
> does
> > not contain the drawing that it's expected to have, so it should be
> in
> > an error state."
> 
> I disagree here...  The cairo_t has no foreknowledge of the contents  
> that are on the surface -- if the application wants to decide that  
> failing rendering on a cairo_t means that the surface is invalid,
> that  
> should be up to the app; it shouldn't be forced on them.

What kind of errors do you have in mind here?  We are going in the
direction that all retained errors are either irrecoverable or
programming errors.  What would an application has to decide about upon
out-of-memory?  Programming error on the other hand, should simply be
fixed.

I agree that this change may cause some pain initially.  But then again,
it most probably wouldn't for GTK+-created surfaces, and PS/PDF/SVG are
typically generated using on cr.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



More information about the cairo mailing list