[clutter] canvas: Propagate Cairo errors when diagnostic mode is enabled



commit 725f4a07f3fb04518646f792b64d3c7fa120091a
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Jun 13 10:23:28 2012 +0100

    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.

 clutter/clutter-canvas.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-canvas.c b/clutter/clutter-canvas.c
index 6bbbde4..43c0e75 100644
--- a/clutter/clutter-canvas.c
+++ b/clutter/clutter-canvas.c
@@ -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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]