[gtk+] gdk: Add GDK_DEBUG=nogl
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Add GDK_DEBUG=nogl
- Date: Thu, 16 Oct 2014 01:33:51 +0000 (UTC)
commit 672a67d0af850623bb154ef32d40b0b28531b5aa
Author: Benjamin Otte <otte redhat com>
Date: Thu Oct 16 03:13:45 2014 +0200
gdk: Add GDK_DEBUG=nogl
This is mostly useful for fallback testing.
I suppose if people want finer grained GL ability testing, they can use
Mesa environment variables to tune things.
docs/reference/gtk/running.sgml | 4 ++++
gdk/gdk.c | 1 +
gdk/gdkinternals.h | 3 ++-
gdk/gdkwindow.c | 8 ++++++++
4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml
index 321593a..3e5f688 100644
--- a/docs/reference/gtk/running.sgml
+++ b/docs/reference/gtk/running.sgml
@@ -400,6 +400,10 @@ nevertheless.
<listitem><para>Miscellaneous information</para></listitem>
</varlistentry>
<varlistentry>
+ <term>nogl</term>
+ <listitem><para>Turn off OpenGL. GDK will behave as if OpenGL support was not
available.</para></listitem>
+ </varlistentry>
+ <varlistentry>
<term>nograbs</term>
<listitem><para>Turn off all pointer and keyboard grabs</para></listitem>
</varlistentry>
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 0b2c388..e40cdea 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -149,6 +149,7 @@ 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},
};
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index d1eb2b1..bb7b71a 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -85,7 +85,8 @@ typedef enum {
GDK_DEBUG_EVENTLOOP = 1 << 10,
GDK_DEBUG_FRAMES = 1 << 11,
GDK_DEBUG_SETTINGS = 1 << 12,
- GDK_DEBUG_OPENGL = 1 << 13
+ GDK_DEBUG_NOGL = 1 << 13,
+ GDK_DEBUG_OPENGL = 1 << 14
} GdkDebugFlag;
typedef enum {
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 89a264c..25d20b1 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2722,6 +2722,14 @@ gdk_window_ref_impl_surface (GdkWindow *window)
GdkGLContext *
gdk_window_get_paint_gl_context (GdkWindow *window, GError **error)
{
+ if (_gdk_debug_flags & GDK_DEBUG_NOGL)
+ {
+ g_set_error_literal (error, GDK_GL_ERROR,
+ GDK_GL_ERROR_NOT_AVAILABLE,
+ _("GL support disabled via GDK_DEBUG"));
+ return NULL;
+ }
+
if (window->impl_window->gl_paint_context == NULL)
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]