From 650c9f3b7eaade447aa341d7c8dd7d9a9aa10188 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 6 Nov 2014 11:29:51 +0100 Subject: [PATCH] Add support for GDK_GL=texture-rectangles This allows us to test our support for GL_ARB_texture_rectangle --- gdk/gdk.c | 1 + gdk/gdkglcontext.c | 4 +++- gdk/gdkinternals.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdk/gdk.c b/gdk/gdk.c index 2b44b0faaf..a4f1f62886 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -140,6 +140,7 @@ static const GDebugKey gdk_gl_keys[] = { {"software-draw", GDK_GL_FLAGS_SOFTWARE_DRAW_GL | GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE}, {"software-draw-gl", GDK_GL_FLAGS_SOFTWARE_DRAW_GL}, {"software-draw-surface", GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE}, + {"texture-rectangle", GDK_GL_FLAGS_TEXTURE_RECTANGLE}, }; #ifdef G_ENABLE_DEBUG diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 1628e51ced..eef707c0b1 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -359,7 +359,9 @@ gdk_gl_context_realize (GdkGLContext *context) has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two"); has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle"); - if (has_npot) + if (_gdk_gl_flags & GDK_GL_FLAGS_TEXTURE_RECTANGLE) + priv->use_texture_rectangle = TRUE; + else if (has_npot) priv->use_texture_rectangle = FALSE; else if (has_texture_rectangle) priv->use_texture_rectangle = TRUE; diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 3a6659bac8..14141bde4c 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -93,6 +93,7 @@ typedef enum { GDK_GL_FLAGS_ALWAYS = 1 << 1, GDK_GL_FLAGS_SOFTWARE_DRAW_GL = 1 << 2, GDK_GL_FLAGS_SOFTWARE_DRAW_SURFACE = 1 << 3, + GDK_GL_FLAGS_TEXTURE_RECTANGLE = 1 << 4, } GdkGLFlags;