Add GDK_ALWAYS_USE_GL debug hack

If this is set we always use GL to render each window, even
if there are no GL widgets in the window.
This commit is contained in:
Alexander Larsson 2014-10-09 11:03:47 +02:00 committed by Matthias Clasen
parent 038aac6275
commit 87970ea2d0

View File

@ -287,11 +287,16 @@ create_surface_accumulator (GSignalInvocationHint *ihint,
static GQuark quark_pointer_window = 0;
static gboolean always_use_gl = FALSE;
static void
gdk_window_class_init (GdkWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
if (g_getenv ("GDK_ALWAYS_USE_GL"))
always_use_gl = TRUE;
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_window_finalize;
@ -1418,6 +1423,18 @@ gdk_window_new (GdkWindow *parent,
g_signal_connect (device_manager, "device-removed",
G_CALLBACK (device_removed_cb), window);
if (always_use_gl)
{
GError *error = NULL;
if (gdk_window_get_paint_gl_context (window, &error) == NULL)
{
g_warning ("Unable to force GL enabled: %s\n", error->message);
g_error_free (error);
}
}
return window;
}