[gtk+/gtk-3-16] x11/gl: Do not call glEnable/glDisable with GL_TEXTURE_2D
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-16] x11/gl: Do not call glEnable/glDisable with GL_TEXTURE_2D
- Date: Mon, 22 Jun 2015 12:05:25 +0000 (UTC)
commit b45caa89991f9f4a2fe134e026f54ce26f8bd4e8
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Mar 23 22:03:00 2015 +0000
x11/gl: Do not call glEnable/glDisable with GL_TEXTURE_2D
These are fixed pipeline functions, and Mesa will warn (if debugging
messages are enabled). At best, they are poinless calls.
(cherry picked from commit 6bd7526ee78828b99bb52cd01f5e43481fb4b995)
Signed-off-by: Emmanuele Bassi <ebassi gnome org>
gdk/x11/gdkglcontext-x11.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 0ce0789..7e39bb6 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -467,7 +467,10 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
glGenTextures (1, &texture_id);
glBindTexture (target, texture_id);
- glEnable (target);
+
+ /* glEnable(GL_TEXTURE_2D) is deprecated */
+ if (target != GL_TEXTURE_2D)
+ glEnable (target);
glTexParameteri (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
@@ -532,7 +535,9 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
glXReleaseTexImageEXT (glx_pixmap->display, glx_pixmap->drawable,
GLX_FRONT_LEFT_EXT);
- glDisable (target);
+ if (target != GL_TEXTURE_2D)
+ glDisable (target);
+
glDeleteTextures (1, &texture_id);
glx_pixmap_destroy(glx_pixmap);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]