[gtk+] Add GDK_ALWAYS_USE_GL debug hack



commit 87970ea2d0eff3eaa148676d7726043e99794c26
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Oct 9 11:03:47 2014 +0200

    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.

 gdk/gdkwindow.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 18c0de6..a737254 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]