1
0
Fork 0

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
This commit is contained in:
Tomeu Vizoso 2011-09-28 14:24:57 +02:00
parent 4f5ce6c165
commit 39db46123e
3 changed files with 24 additions and 2 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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 */