2022-09-23 01:36:50 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
#include "gskdebugprivate.h"
|
2022-09-24 03:23:27 +00:00
|
|
|
#include "gdk/gdkprivate.h"
|
2016-03-17 13:48:19 +00:00
|
|
|
|
2020-06-28 03:09:55 +00:00
|
|
|
static const GdkDebugKey gsk_debug_keys[] = {
|
|
|
|
{ "renderer", GSK_DEBUG_RENDERER, "General renderer information" },
|
|
|
|
{ "opengl", GSK_DEBUG_OPENGL, "OpenGL renderer information" },
|
|
|
|
{ "vulkan", GSK_DEBUG_VULKAN, "Vulkan renderer information" },
|
|
|
|
{ "shaders", GSK_DEBUG_SHADERS, "Information about shaders" },
|
|
|
|
{ "surface", GSK_DEBUG_SURFACE, "Information about surfaces" },
|
2023-12-26 16:19:20 +00:00
|
|
|
{ "fallback", GSK_DEBUG_FALLBACK, "Information about fallback usage in renderers" },
|
2020-06-28 03:09:55 +00:00
|
|
|
{ "glyphcache", GSK_DEBUG_GLYPH_CACHE, "Information about glyph caching" },
|
2023-07-05 04:32:52 +00:00
|
|
|
{ "verbose", GSK_DEBUG_VERBOSE, "Print verbose output while rendering" },
|
2020-07-20 01:21:41 +00:00
|
|
|
{ "geometry", GSK_DEBUG_GEOMETRY, "Show borders (when using cairo)" },
|
2020-06-28 03:09:55 +00:00
|
|
|
{ "full-redraw", GSK_DEBUG_FULL_REDRAW, "Force full redraws" },
|
|
|
|
{ "sync", GSK_DEBUG_SYNC, "Sync after each frame" },
|
2023-06-14 01:31:11 +00:00
|
|
|
{ "staging", GSK_DEBUG_STAGING, "Use a staging image for texture upload (Vulkan only)" },
|
2023-10-27 19:37:37 +00:00
|
|
|
{ "offload-disable", GSK_DEBUG_OFFLOAD_DISABLE, "Disable graphics offload" },
|
2023-12-26 03:53:09 +00:00
|
|
|
{ "cairo", GSK_DEBUG_CAIRO, "Overlay error pattern over Cairo drawing (finds fallbacks)" },
|
2016-03-17 13:48:19 +00:00
|
|
|
};
|
|
|
|
|
2018-01-14 14:52:52 +00:00
|
|
|
static guint gsk_debug_flags;
|
|
|
|
|
|
|
|
static void
|
|
|
|
init_debug_flags (void)
|
2016-03-17 13:48:19 +00:00
|
|
|
{
|
2020-11-19 03:58:09 +00:00
|
|
|
static gsize gsk_debug_flags__set;
|
2016-03-17 13:48:19 +00:00
|
|
|
|
|
|
|
if (g_once_init_enter (&gsk_debug_flags__set))
|
|
|
|
{
|
2020-06-28 03:09:55 +00:00
|
|
|
gsk_debug_flags = gdk_parse_debug_var ("GSK_DEBUG",
|
|
|
|
gsk_debug_keys,
|
|
|
|
G_N_ELEMENTS (gsk_debug_keys));
|
2016-03-17 13:48:19 +00:00
|
|
|
|
|
|
|
g_once_init_leave (&gsk_debug_flags__set, TRUE);
|
|
|
|
}
|
2018-01-14 14:52:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gsk_check_debug_flags (GskDebugFlags flags)
|
|
|
|
{
|
|
|
|
init_debug_flags ();
|
2016-03-17 13:48:19 +00:00
|
|
|
return (gsk_debug_flags & flags) != 0;
|
2018-01-14 14:52:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GskDebugFlags
|
|
|
|
gsk_get_debug_flags (void)
|
|
|
|
{
|
|
|
|
init_debug_flags ();
|
|
|
|
return gsk_debug_flags;
|
2016-03-17 13:48:19 +00:00
|
|
|
}
|
2018-01-14 21:06:25 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
gsk_set_debug_flags (GskDebugFlags flags)
|
|
|
|
{
|
|
|
|
init_debug_flags ();
|
|
|
|
gsk_debug_flags = flags;
|
|
|
|
}
|