Add some debugging notes for picking

This adds a new CLUTTER_DEBUG option for picking. Currently this just
reports the position for each pick and whether it is clipped or not.
This commit is contained in:
Neil Roberts 2010-08-23 11:33:22 +01:00
parent 12e58c7813
commit ddd08ba723
2 changed files with 9 additions and 1 deletions

View File

@ -22,7 +22,8 @@ typedef enum {
CLUTTER_DEBUG_SHADER = 1 << 12,
CLUTTER_DEBUG_MULTISTAGE = 1 << 13,
CLUTTER_DEBUG_ANIMATION = 1 << 14,
CLUTTER_DEBUG_LAYOUT = 1 << 15
CLUTTER_DEBUG_LAYOUT = 1 << 15,
CLUTTER_DEBUG_PICK = 1 << 16
} ClutterDebugFlag;
typedef enum {

View File

@ -156,6 +156,7 @@ static const GDebugKey clutter_debug_keys[] = {
{ "texture", CLUTTER_DEBUG_TEXTURE },
{ "event", CLUTTER_DEBUG_EVENT },
{ "paint", CLUTTER_DEBUG_PAINT },
{ "pick", CLUTTER_DEBUG_PICK },
{ "gl", CLUTTER_DEBUG_GL },
{ "alpha", CLUTTER_DEBUG_ALPHA },
{ "behaviour", CLUTTER_DEBUG_BEHAVIOUR },
@ -637,6 +638,9 @@ _clutter_do_pick (ClutterStage *stage,
pixel);
CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_read);
CLUTTER_NOTE (PICK, "Reusing pick buffer from previous render to fetch "
"actor at %i,%i", x, y);
/* FIXME: This is a lazy copy and paste of the logic at the end of this
* function used when we actually do a pick render. It should be
* consolidated somehow.
@ -672,6 +676,9 @@ _clutter_do_pick (ClutterStage *stage,
else
is_clipped = FALSE;
CLUTTER_NOTE (PICK, "Performing %s pick at %i,%i",
is_clipped ? "clippped" : "full", x, y);
cogl_disable_fog ();
cogl_color_set_from_4ub (&stage_pick_id, 255, 255, 255, 255);
CLUTTER_TIMER_START (_clutter_uprof_context, pick_clear);