forked from AuroraMiddleware/gtk
7afdd3fdb5
GSK is conceptually split into two scene graphs: * a simple rendering tree of operations * a complex set of logical layers The latter is built on the former, and adds convenience and high level API for application developers. The lower layer, though, is what gets transformed into the rendering pipeline, as it's simple and thus can be transformed into appropriate rendering commands with minimal state changes. The lower layer is also suitable for reuse from more complex higher layers, like the CSS machinery in GTK, without necessarily port those layers to the GSK high level API. This lower layer is based on GskRenderNode instances, which represent the tree of rendering operations; and a GskRenderer instance, which takes the render nodes and submits them (after potentially reordering and transforming them to a more appropriate representation) to the underlying graphic system.
59 lines
1.5 KiB
C
59 lines
1.5 KiB
C
#include "gskdebugprivate.h"
|
|
|
|
#ifdef G_ENABLE_DEBUG
|
|
static const GDebugKey gsk_debug_keys[] = {
|
|
{ "rendernode", GSK_DEBUG_RENDER_NODE },
|
|
{ "renderer", GSK_DEBUG_RENDERER },
|
|
{ "cairo", GSK_DEBUG_CAIRO },
|
|
{ "opengl", GSK_DEBUG_OPENGL },
|
|
};
|
|
#endif
|
|
|
|
static const GDebugKey gsk_rendering_keys[] = {
|
|
{ "geometry", GSK_RENDERING_MODE_GEOMETRY },
|
|
};
|
|
|
|
gboolean
|
|
gsk_check_debug_flags (GskDebugFlags flags)
|
|
{
|
|
#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))
|
|
{
|
|
const char *env = g_getenv ("GSK_DEBUG");
|
|
|
|
gsk_debug_flags = g_parse_debug_string (env,
|
|
(GDebugKey *) gsk_debug_keys,
|
|
G_N_ELEMENTS (gsk_debug_keys));
|
|
|
|
g_once_init_leave (&gsk_debug_flags__set, TRUE);
|
|
}
|
|
|
|
return (gsk_debug_flags & flags) != 0;
|
|
#else
|
|
return FALSE;
|
|
#endif
|
|
}
|
|
|
|
gboolean
|
|
gsk_check_rendering_flags (GskRenderingMode flags)
|
|
{
|
|
static volatile gsize gsk_rendering_flags__set;
|
|
static guint gsk_rendering_flags;
|
|
|
|
if (g_once_init_enter (&gsk_rendering_flags__set))
|
|
{
|
|
const char *env = g_getenv ("GSK_RENDERING_MODE");
|
|
|
|
gsk_rendering_flags = g_parse_debug_string (env,
|
|
(GDebugKey *) gsk_rendering_keys,
|
|
G_N_ELEMENTS (gsk_rendering_keys));
|
|
|
|
g_once_init_leave (&gsk_rendering_flags__set, TRUE);
|
|
}
|
|
|
|
return (gsk_rendering_flags & flags) != 0;
|
|
}
|