Allow changing Clutter debug flags at runtime
This way, we can literally pop up the Looking Glass and call: >>> Meta.add_clutter_debug_flags(Clutter.DebugFlag.FRAME_TIME, 0, 0) And measure specific actions or events on GNOME Shell. https://gitlab.gnome.org/GNOME/mutter/merge_requests/502
This commit is contained in:
parent
4904430083
commit
f7321d235f
@ -6,47 +6,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_MISC = 1 << 0,
|
|
||||||
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
|
||||||
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
|
||||||
CLUTTER_DEBUG_EVENT = 1 << 3,
|
|
||||||
CLUTTER_DEBUG_PAINT = 1 << 4,
|
|
||||||
CLUTTER_DEBUG_PANGO = 1 << 5,
|
|
||||||
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
|
||||||
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
|
||||||
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
|
||||||
CLUTTER_DEBUG_SHADER = 1 << 9,
|
|
||||||
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
|
||||||
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
|
||||||
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
|
||||||
CLUTTER_DEBUG_PICK = 1 << 13,
|
|
||||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
|
||||||
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
|
||||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16,
|
|
||||||
CLUTTER_DEBUG_FRAME_TIME = 1 << 17,
|
|
||||||
} ClutterDebugFlag;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
|
||||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
|
||||||
} ClutterPickDebugFlag;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
|
||||||
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
|
||||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
|
||||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
|
||||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
|
||||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
|
||||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
|
||||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
|
||||||
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
|
||||||
} ClutterDrawDebugFlag;
|
|
||||||
|
|
||||||
#ifdef CLUTTER_ENABLE_DEBUG
|
#ifdef CLUTTER_ENABLE_DEBUG
|
||||||
|
|
||||||
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
|
||||||
|
@ -3557,6 +3557,36 @@ clutter_check_windowing_backend (const char *backend_type)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_add_debug_flags: (skip)
|
||||||
|
*
|
||||||
|
* Adds the debug flags passed to the list of debug flags.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_add_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_debug_flags |= debug_flags;
|
||||||
|
clutter_paint_debug_flags |= draw_flags;
|
||||||
|
clutter_pick_debug_flags |= pick_flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_remove_debug_flags: (skip)
|
||||||
|
*
|
||||||
|
* Removes the debug flags passed from the list of debug flags.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_debug_flags &= ~debug_flags;
|
||||||
|
clutter_paint_debug_flags &= ~draw_flags;
|
||||||
|
clutter_pick_debug_flags &= ~pick_flags;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,48 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_MISC = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
||||||
|
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
||||||
|
CLUTTER_DEBUG_EVENT = 1 << 3,
|
||||||
|
CLUTTER_DEBUG_PAINT = 1 << 4,
|
||||||
|
CLUTTER_DEBUG_PANGO = 1 << 5,
|
||||||
|
CLUTTER_DEBUG_BACKEND = 1 << 6,
|
||||||
|
CLUTTER_DEBUG_SCHEDULER = 1 << 7,
|
||||||
|
CLUTTER_DEBUG_SCRIPT = 1 << 8,
|
||||||
|
CLUTTER_DEBUG_SHADER = 1 << 9,
|
||||||
|
CLUTTER_DEBUG_MULTISTAGE = 1 << 10,
|
||||||
|
CLUTTER_DEBUG_ANIMATION = 1 << 11,
|
||||||
|
CLUTTER_DEBUG_LAYOUT = 1 << 12,
|
||||||
|
CLUTTER_DEBUG_PICK = 1 << 13,
|
||||||
|
CLUTTER_DEBUG_EVENTLOOP = 1 << 14,
|
||||||
|
CLUTTER_DEBUG_CLIPPING = 1 << 15,
|
||||||
|
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 16,
|
||||||
|
CLUTTER_DEBUG_FRAME_TIME = 1 << 17,
|
||||||
|
} ClutterDebugFlag;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_NOP_PICKING = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_DUMP_PICK_BUFFERS = 1 << 1
|
||||||
|
} ClutterPickDebugFlag;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
|
||||||
|
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
|
||||||
|
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||||
|
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||||
|
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||||
|
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||||
|
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||||
|
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
|
||||||
|
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
|
||||||
|
} ClutterDrawDebugFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CLUTTER_INIT_ERROR:
|
* CLUTTER_INIT_ERROR:
|
||||||
*
|
*
|
||||||
@ -174,6 +216,15 @@ guint clutter_get_default_frame_rate (void);
|
|||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_check_windowing_backend (const char *backend_type);
|
gboolean clutter_check_windowing_backend (const char *backend_type);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_add_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_remove_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -1012,5 +1012,22 @@ meta_generate_random_id (GRand *rand,
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_add_clutter_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_add_debug_flags (debug_flags, draw_flags, pick_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_remove_clutter_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags)
|
||||||
|
{
|
||||||
|
clutter_remove_debug_flags (debug_flags, draw_flags, pick_flags);
|
||||||
|
}
|
||||||
|
|
||||||
/* eof util.c */
|
/* eof util.c */
|
||||||
|
|
||||||
|
@ -226,4 +226,14 @@ typedef enum
|
|||||||
META_EXPORT
|
META_EXPORT
|
||||||
MetaLocaleDirection meta_get_locale_direction (void);
|
MetaLocaleDirection meta_get_locale_direction (void);
|
||||||
|
|
||||||
|
META_EXPORT
|
||||||
|
void meta_add_clutter_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
|
META_EXPORT
|
||||||
|
void meta_remove_clutter_debug_flags (ClutterDebugFlag debug_flags,
|
||||||
|
ClutterDrawDebugFlag draw_flags,
|
||||||
|
ClutterPickDebugFlag pick_flags);
|
||||||
|
|
||||||
#endif /* META_UTIL_H */
|
#endif /* META_UTIL_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user