[cairo] How soon to call cairo_error?

Baz brian.ewins at gmail.com
Sat Oct 27 07:56:05 PDT 2007


On 27/10/2007, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> I've found the fine-grained _cairo_error() very useful, as I'm sure
> have, or perhaps will have, a number of other Cairo developers - I
> recall Behdad complaining a couple of times about how hard it was to
> find precisely where the error occurred. And when it's coupled with a
> stacktrace it becomes much more useful. I've usually just plugged a
> VALGRIND_PRINTF_BACKTRACE() into _cairo_error(), but there were murmurs
> about including util/backtrace-symbols for supported architectures.

I do agree this is incredibly useful, but it would be even more useful
if we could use it for the cases where we can't call _cairo_error
because it causes an assertion - eg CAIRO_INT_STATUS_UNSUPPORTED (I'd
like to trace what's still triggering fallbacks on the mac in firefox;
Adrian would like to know what path triggered a use of a fallback
font, etc).

It might be useful to split this into two: _cairo_internal_error(),
say, for the original cause inside cairo, and _cairo_error in only in
API entry points as per Carl's original intent. The _cairo_error here
would also act as a gatekeeper to prevent us returning
cairo_int_status_t to the user.

Cheers,
Baz


More information about the cairo mailing list