diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-01-14 09:52:52 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-01-14 17:05:04 -0500 |
commit | c56419818fac67cdf653e1254e68553f5371e7aa (patch) | |
tree | 36893f9a7495ad4c066bdc54845d927592651720 /gsk/gskdebug.c | |
parent | 782c76c146dc0af26aeea50992f60e346e4f93f5 (diff) | |
download | gtk+-c56419818fac67cdf653e1254e68553f5371e7aa.tar.gz |
gsk: make logging per-renderer
Add a setter for per-renderer debug flags, and use
them where possible. Some places don't have easy access
to a renderer, so this is not complete.
Also, use g_message instead of g_print throughout.
Diffstat (limited to 'gsk/gskdebug.c')
-rw-r--r-- | gsk/gskdebug.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gsk/gskdebug.c b/gsk/gskdebug.c index 04521f93e5..61e555dda8 100644 --- a/gsk/gskdebug.c +++ b/gsk/gskdebug.c @@ -22,12 +22,13 @@ static const GDebugKey gsk_rendering_keys[] = { { "staging-buffer", GSK_RENDERING_MODE_STAGING_BUFFER } }; -gboolean -gsk_check_debug_flags (GskDebugFlags flags) +static guint gsk_debug_flags; + +static void +init_debug_flags (void) { #ifdef G_ENABLE_DEBUG static volatile gsize gsk_debug_flags__set; - static guint gsk_debug_flags; if (g_once_init_enter (&gsk_debug_flags__set)) { @@ -39,11 +40,23 @@ gsk_check_debug_flags (GskDebugFlags flags) g_once_init_leave (&gsk_debug_flags__set, TRUE); } +#endif +} + +gboolean +gsk_check_debug_flags (GskDebugFlags flags) +{ + init_debug_flags (); return (gsk_debug_flags & flags) != 0; -#else - return FALSE; -#endif +} + +GskDebugFlags +gsk_get_debug_flags (void) +{ + init_debug_flags (); + + return gsk_debug_flags; } gboolean |