summaryrefslogtreecommitdiff
path: root/gdk/gdk.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2014-11-06 10:21:48 +0100
committerAlexander Larsson <alexl@redhat.com>2014-11-06 12:24:43 +0100
commit90a5fa80af4e826b1b89175f499d9e6b05b7c32e (patch)
treea19c264dc4a9396f2f5d8755f3a6f6f651433bdb /gdk/gdk.c
parent7fde5213b011782c692d2d18f52649a463307166 (diff)
downloadgtk+-90a5fa80af4e826b1b89175f499d9e6b05b7c32e.tar.gz
Add GDK_GL env var and GdkGLFlags
This moves the GDK_ALWAYS_USE_GL env var to GDK_GL=always. It also changes GDK_DEBUG=nogl to GDK_GL=disable, as GDK_DEBUG is really only about debug loggin. It also adds some completely new flags: software-draw-gl: Always use software fallback for drawing gl content to a cairo_t. This disables the fastpaths that exist for drawing directly to a window and instead reads back the pixels into a cairo image surface. software-draw-surface: Always use software fallback for drawing cairo surfaces onto a gl-using window. This disables e.g. texture-from-pixmap on X11. software-draw: Enables both the above.
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r--gdk/gdk.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index e40cdea1a3..2b44b0faaf 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -134,6 +134,14 @@ static GMutex gdk_threads_mutex;
static GCallback gdk_threads_lock = NULL;
static GCallback gdk_threads_unlock = NULL;
+static const GDebugKey gdk_gl_keys[] = {
+ {"disable", GDK_GL_FLAGS_DISABLE},
+ {"always", GDK_GL_FLAGS_ALWAYS},
+ {"software-draw", GDK_GL_FLAGS_SOFTWARE_DRAW_GL | GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE},
+ {"software-draw-gl", GDK_GL_FLAGS_SOFTWARE_DRAW_GL},
+ {"software-draw-surface", GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE},
+};
+
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
@@ -149,7 +157,6 @@ static const GDebugKey gdk_debug_keys[] = {
{"eventloop", GDK_DEBUG_EVENTLOOP},
{"frames", GDK_DEBUG_FRAMES},
{"settings", GDK_DEBUG_SETTINGS},
- {"nogl", GDK_DEBUG_NOGL},
{"opengl", GDK_DEBUG_OPENGL},
};
@@ -248,6 +255,7 @@ void
gdk_pre_parse_libgtk_only (void)
{
const char *rendering_mode;
+ const gchar *gl_string;
gdk_initialized = TRUE;
@@ -268,6 +276,12 @@ gdk_pre_parse_libgtk_only (void)
}
#endif /* G_ENABLE_DEBUG */
+ gl_string = getenv("GDK_GL");
+ if (gl_string != NULL)
+ _gdk_gl_flags = g_parse_debug_string (gl_string,
+ (GDebugKey *) gdk_gl_keys,
+ G_N_ELEMENTS (gdk_gl_keys));
+
if (getenv ("GDK_NATIVE_WINDOWS"))
{
g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"