Make the gl-legacy debug flag always available
authorMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:09:08 +0000 (21:09 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:09:08 +0000 (21:09 -0400)
No need to restrict this to debug builds.

gdk/gdk.c
gdk/gdkglcontext.c
gdk/win32/gdkglcontext-win32-wgl.c
gdk/x11/gdkglcontext-glx.c

index f35f1ea8cff2447bc7912446d77015ad18d7cb43..637f76fb6a86c444fba2555b06f4e9812d8565f4 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -119,7 +119,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
   { "nograbs",         GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
   { "portals",         GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
   { "gl-disable",      GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
-  { "gl-legacy",       GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
+  { "gl-legacy",       GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
   { "gl-gles",         GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API" },
   { "gl-debug",        GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
   { "gl-egl",          GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows" },
index 3f22c00065307a7f7b7d3dcba5099eae9e369180..001addb6222092c72da61d1f1f8690486e39266c 100644 (file)
@@ -395,8 +395,8 @@ gdk_gl_context_realize_egl (GdkGLContext  *context,
       return 0;
     }
 
-  prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
-                   (share != NULL && gdk_gl_context_is_legacy (share)));
+  prefer_legacy = (gdk_display_get_debug_flags(display) & GDK_DEBUG_GL_LEGACY) ||
+                   (share != NULL && gdk_gl_context_is_legacy (share));
 
   if (preferred_api == GDK_GL_API_GL)
     {
index d7ff4367f22280a11cd0738c6ae692ac576ed44f..4fe04828ffb5c3a58cb8f097f922f079d0fc746a 100644 (file)
@@ -564,9 +564,9 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
    * A legacy context cannot be shared with core profile ones, so this means we
    * must stick to a legacy context if the shared context is a legacy context
    */
-  legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ?
-               TRUE :
-                          share != NULL && gdk_gl_context_is_legacy (share);
+  legacy_bit = (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_LEGACY)
+                 ? TRUE
+                 : share != NULL && gdk_gl_context_is_legacy (share);
 
   if (!set_wgl_pixformat_for_hdc (hdc,
                                  &pixel_format,
index d9e60bd7475d67fb5f1336255d71f9af4195d471..2033e42902fa760379d0d83287b6a472a88b993d 100644 (file)
@@ -609,7 +609,7 @@ gdk_x11_gl_context_glx_realize (GdkGLContext  *context,
   /* If there is no glXCreateContextAttribsARB() then we default to legacy */
   legacy = !GDK_X11_DISPLAY (display)->has_glx_create_context;
 
-  if (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY))
+  if (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_LEGACY)
     legacy = TRUE;
 
   /* We cannot share legacy contexts with core profile ones, so the