[clutter] Add paint-deform-tiles option to CLUTTER_DEBUG



commit 39db46123ed6bbbc3e6ad359a64d4d344ca9e11b
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Wed Sep 28 14:24:57 2011 +0200

    Add paint-deform-tiles option to CLUTTER_DEBUG
    
    To make easier to visualize the triangles in a ClutterDeformEffect
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660354

 clutter/clutter-debug.h         |    3 ++-
 clutter/clutter-deform-effect.c |   20 ++++++++++++++++++++
 clutter/clutter-main.c          |    3 ++-
 3 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-debug.h b/clutter/clutter-debug.h
index f4a9bf8..be551e1 100644
--- a/clutter/clutter-debug.h
+++ b/clutter/clutter-debug.h
@@ -27,7 +27,8 @@ typedef enum {
   CLUTTER_DEBUG_PICK                = 1 << 16,
   CLUTTER_DEBUG_EVENTLOOP           = 1 << 17,
   CLUTTER_DEBUG_CLIPPING            = 1 << 18,
-  CLUTTER_DEBUG_OOB_TRANSFORMS      = 1 << 19
+  CLUTTER_DEBUG_OOB_TRANSFORMS      = 1 << 19,
+  CLUTTER_DEBUG_PAINT_DEFORM_TILES  = 1 << 20,
 } ClutterDebugFlag;
 
 typedef enum {
diff --git a/clutter/clutter-deform-effect.c b/clutter/clutter-deform-effect.c
index 2454f23..8037a1d 100644
--- a/clutter/clutter-deform-effect.c
+++ b/clutter/clutter-deform-effect.c
@@ -290,6 +290,26 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
     cogl_set_backface_culling_enabled (FALSE);
   else if (priv->back_material == COGL_INVALID_HANDLE && is_cull_enabled)
     cogl_set_backface_culling_enabled (TRUE);
+
+  if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_PAINT_DEFORM_TILES))
+    {
+      cogl_set_source_color4f (1.0, 0, 0, 1.0);
+      cogl_vertex_buffer_draw_elements (priv->vbo,
+                                        COGL_VERTICES_MODE_LINE_STRIP,
+                                        priv->indices,
+                                        0,
+                                        n_tiles,
+                                        0,
+                                        priv->n_indices);
+
+      cogl_vertex_buffer_draw_elements (priv->vbo,
+                                        COGL_VERTICES_MODE_LINE_STRIP,
+                                        priv->back_indices,
+                                        0,
+                                        n_tiles,
+                                        0,
+                                        priv->n_indices);
+    }
 }
 
 static inline void
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index 70fd22a..a589b12 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -168,7 +168,8 @@ static const GDebugKey clutter_debug_keys[] = {
   { "animation", CLUTTER_DEBUG_ANIMATION },
   { "layout", CLUTTER_DEBUG_LAYOUT },
   { "clipping", CLUTTER_DEBUG_CLIPPING },
-  { "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS }
+  { "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS },
+  { "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
 };
 #endif /* CLUTTER_ENABLE_DEBUG */
 



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