canvas: Propagate Cairo errors when diagnostic mode is enabled

It can be a useful debugging tool to report the eventual error state of
the cairo_t after the ::draw signal emission ended.
This commit is contained in:
Emmanuele Bassi 2012-06-13 10:23:28 +01:00
parent b4222db71d
commit 725f4a07f3

View File

@ -402,6 +402,15 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
cr, priv->width, priv->height,
&res);
#ifdef CLUTTER_ENABLE_DEBUG
if (_clutter_diagnostic_enabled () && cairo_status (cr))
{
g_warning ("Drawing failed for <ClutterCanvas>[%p]: %s",
self,
cairo_status_to_string (cairo_status (cr)));
}
#endif
self->priv->cr = NULL;
cairo_destroy (cr);