mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
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.
This commit is contained in:
parent
8a7bd5cc00
commit
672a67d0af
@ -399,6 +399,10 @@ nevertheless.
|
||||
<term>misc</term>
|
||||
<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>
|
||||
|
@ -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},
|
||||
};
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user