gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
authorMatthew Waters <matthew@centricular.com>
Thu, 14 May 2015 06:42:09 +0000 (16:42 +1000)
committerMatthew Waters <matthew@centricular.com>
Thu, 14 May 2015 06:42:09 +0000 (16:42 +1000)
We are using shaders everywhere and so they are not needed

27 files changed:
ext/gl/effects/gstgleffectblur.c
ext/gl/effects/gstgleffectbulge.c
ext/gl/effects/gstgleffectfisheye.c
ext/gl/effects/gstgleffectglow.c
ext/gl/effects/gstgleffectlaplacian.c
ext/gl/effects/gstgleffectlumatocurve.c
ext/gl/effects/gstgleffectmirror.c
ext/gl/effects/gstgleffectrgbtocurve.c
ext/gl/effects/gstgleffectsin.c
ext/gl/effects/gstgleffectsobel.c
ext/gl/effects/gstgleffectsquare.c
ext/gl/effects/gstgleffectsqueeze.c
ext/gl/effects/gstgleffectstretch.c
ext/gl/effects/gstgleffecttunnel.c
ext/gl/effects/gstgleffecttwirl.c
ext/gl/effects/gstgleffectxray.c
ext/gl/gltestsrc.c
ext/gl/gstgldeinterlace.c
ext/gl/gstgldifferencematte.c
ext/gl/gstglfilterglass.c
ext/gl/gstglimagesink.c
ext/gl/gstglmosaic.c
ext/gl/gstgloverlay.c
ext/gl/gstglvideomixer.c
gst-libs/gst/gl/gstglfilter.c
tests/check/libs/gstglcontext.c
tests/check/libs/gstglupload.c

index 07eb38d..8042b27 100644 (file)
@@ -62,9 +62,7 @@ gst_gl_effects_blur_callback_hconv (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1f (shader, "gauss_width", width);
@@ -97,9 +95,7 @@ gst_gl_effects_blur_callback_vconv (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1f (shader, "gauss_height", height);
index 2e21025..f228867 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index c94cd42..2be8609 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index b387715..97277b8 100644 (file)
@@ -53,7 +53,6 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
@@ -91,9 +90,7 @@ gst_gl_effects_glow_step_two (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
@@ -128,9 +125,7 @@ gst_gl_effects_glow_step_three (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
@@ -165,17 +160,13 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE2);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, effects->intexture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0f);
   gst_gl_shader_set_uniform_1i (shader, "base", 2);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
   gst_gl_shader_set_uniform_1i (shader, "blend", 1);
index b9dabcb..a6eadcc 100644 (file)
@@ -51,9 +51,7 @@ gst_gl_effects_laplacian_callback (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1f (shader, "height", height);
index 0a925fe..f4e303c 100644 (file)
@@ -56,7 +56,6 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
 
 #if GST_GL_HAVE_OPENGL
     if (USING_OPENGL (context)) {
-      gl->Enable (GL_TEXTURE_1D);
       gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
       gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -65,12 +64,9 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
 
       gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
           curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-
-      gl->Disable (GL_TEXTURE_1D);
     }
 #endif
     if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
-      gl->Enable (GL_TEXTURE_2D);
       gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
       gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -79,37 +75,27 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
 
       gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
           curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-      gl->Disable (GL_TEXTURE_2D);
     }
   }
 
   gl->ActiveTexture (GL_TEXTURE2);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 2);
 
-  gl->Disable (GL_TEXTURE_2D);
-
 #if GST_GL_HAVE_OPENGL
   if (USING_OPENGL (context)) {
     gl->ActiveTexture (GL_TEXTURE1);
-    gl->Enable (GL_TEXTURE_1D);
     gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
 
     gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
-    gl->Disable (GL_TEXTURE_1D);
   }
 #endif
   if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
     gl->ActiveTexture (GL_TEXTURE1);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
 
     gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
-    gl->Disable (GL_TEXTURE_2D);
   }
 
   gst_gl_filter_draw_texture (filter, texture, width, height);
index 7a88f07..4f5d473 100644 (file)
@@ -49,8 +49,6 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  if (USING_OPENGL (context))
-    gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index b34a3f3..b2d84e1 100644 (file)
@@ -54,7 +54,6 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
     gl->GenTextures (1, &effects->curve[curve_index]);
 #if GST_GL_HAVE_OPENGL
     if (USING_OPENGL (context)) {
-      gl->Enable (GL_TEXTURE_1D);
       gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
       gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -63,12 +62,9 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
 
       gl->TexImage1D (GL_TEXTURE_1D, 0, GL_RGB,
           curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-
-      gl->Disable (GL_TEXTURE_1D);
     }
 #endif
     if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
-      gl->Enable (GL_TEXTURE_2D);
       gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
       gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -77,37 +73,27 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
 
       gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
           curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-      gl->Disable (GL_TEXTURE_2D);
     }
   }
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
 
-  gl->Disable (GL_TEXTURE_2D);
-
 #if GST_GL_HAVE_OPENGL
   if (USING_OPENGL (context)) {
     gl->ActiveTexture (GL_TEXTURE1);
-    gl->Enable (GL_TEXTURE_1D);
     gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
 
     gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
-    gl->Disable (GL_TEXTURE_1D);
   }
 #endif
   if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
     gl->ActiveTexture (GL_TEXTURE1);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
 
     gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
-    gl->Disable (GL_TEXTURE_2D);
   }
 
   gst_gl_filter_draw_texture (filter, texture, width, height);
index a28414d..302b2bb 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index fcb7847..a18dbd3 100644 (file)
@@ -48,9 +48,7 @@ gst_gl_effects_sobel_callback_desaturate (gint width, gint height,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
 
@@ -81,9 +79,7 @@ gst_gl_effects_sobel_callback_hconv (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1f (shader, "width", width);
@@ -115,9 +111,7 @@ gst_gl_effects_sobel_callback_vconv (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1f (shader, "height", height);
@@ -149,9 +143,7 @@ gst_gl_effects_sobel_callback_length (gint width, gint height, guint texture,
     gst_gl_shader_use (shader);
 
     gl->ActiveTexture (GL_TEXTURE0);
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_set_uniform_1i (shader, "tex", 0);
     gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert);
index 40dd313..1dc09a2 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index 7ba5e52..249deff 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index 0c645f9..8c39636 100644 (file)
@@ -48,7 +48,6 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index 3bacdae..e4c879f 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index 2061c87..96dceea 100644 (file)
@@ -49,7 +49,6 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 0);
index 5f104df..b25ecc1 100644 (file)
@@ -68,9 +68,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
@@ -105,9 +103,7 @@ gst_gl_effects_xray_step_three (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
@@ -143,9 +139,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_filter_draw_texture (filter, texture, width, height);
@@ -178,9 +172,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1f (shader, "width", width);
@@ -215,9 +207,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1f (shader, "height", height);
@@ -252,9 +242,7 @@ gst_gl_effects_xray_sobel_length (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "tex", 1);
   gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
@@ -289,16 +277,12 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
   gst_gl_shader_use (shader);
 
   gl->ActiveTexture (GL_TEXTURE2);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (shader, "base", 2);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
   gst_gl_shader_set_uniform_1i (shader, "blend", 1);
index d5e75aa..c4a2765 100644 (file)
@@ -92,7 +92,6 @@ gst_gl_test_src_smpte (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
     glDisable (GL_CULL_FACE);
-    glDisable (GL_TEXTURE_2D);
 
     glMatrixMode (GL_PROJECTION);
     glLoadIdentity ();
@@ -229,7 +228,6 @@ gst_gl_test_src_shader (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
 
     gst_gl_context_clear_shader (v->context);
     gl->BindTexture (GL_TEXTURE_2D, 0);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_use (v->shader);
 
@@ -322,7 +320,6 @@ gst_gl_test_src_checkers (GstGLTestSrc * v, gint checker_width)
 
     gst_gl_context_clear_shader (v->context);
     gl->BindTexture (GL_TEXTURE_2D, 0);
-    gl->Disable (GL_TEXTURE_2D);
 
     gst_gl_shader_use (v->shader);
 
index ce66666..2d48749 100644 (file)
@@ -290,8 +290,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
 
   gst_gl_shader_use (deinterlace_filter->shader);
 
-  gl->Enable (GL_TEXTURE_2D);
-
   if (G_UNLIKELY (deinterlace_filter->prev_tex == 0)) {
     gst_gl_context_gen_texture (GST_GL_BASE_FILTER (filter)->context,
         &deinterlace_filter->prev_tex,
@@ -306,7 +304,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
 
   gl->ActiveTexture (GL_TEXTURE0);
   gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex", 0);
-  gl->BindTexture (GL_TEXTURE_2D, texture);
 
   gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb",
       5.0f / 255.0f);
@@ -340,8 +337,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
   gl->ClientActiveTexture (GL_TEXTURE0);
   gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
 
-  gl->Disable (GL_TEXTURE_2D);
-
   if (texture == filter->in_tex_id) {
     temp = filter->in_tex_id;
     filter->in_tex_id = deinterlace_filter->prev_tex;
index 4f0a8f6..fe9e246 100644 (file)
@@ -303,16 +303,12 @@ gst_gl_differencematte_diff (gint width, gint height, guint texture,
   gst_gl_shader_use (differencematte->shader[0]);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[0], "current", 0);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, differencematte->savedbgtexture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[0], "saved", 1);
 
@@ -333,9 +329,7 @@ gst_gl_differencematte_hblur (gint width, gint height, guint texture,
   gst_gl_shader_use (differencematte->shader[1]);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[1], "tex", 0);
 
@@ -360,9 +354,7 @@ gst_gl_differencematte_vblur (gint width, gint height, guint texture,
   gst_gl_shader_use (differencematte->shader[2]);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[2], "tex", 0);
 
@@ -387,23 +379,17 @@ gst_gl_differencematte_interp (gint width, gint height, guint texture,
   gst_gl_shader_use (differencematte->shader[3]);
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[3], "blend", 0);
 
   gl->ActiveTexture (GL_TEXTURE1);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, differencematte->newbgtexture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[3], "base", 1);
 
   gl->ActiveTexture (GL_TEXTURE2);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, differencematte->midtexture[2]);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2);
 
index 0709954..863793c 100644 (file)
@@ -329,9 +329,7 @@ gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
   };
 
   gl->ActiveTexture (GL_TEXTURE0);
-  gl->Enable (GL_TEXTURE_2D);
   gl->BindTexture (GL_TEXTURE_2D, texture);
-  gl->Disable (GL_TEXTURE_2D);
 
   gst_gl_shader_set_uniform_1i (glass_filter->shader, "tex", 0);
   gst_gl_shader_set_uniform_1f (glass_filter->shader, "yrot", rotation);
@@ -408,6 +406,5 @@ gst_gl_filter_glass_callback (gpointer stuff)
 
   gst_gl_context_clear_shader (GST_GL_BASE_FILTER (filter)->context);
 
-  gl->Disable (GL_TEXTURE_2D);
   gl->Disable (GL_BLEND);
 }
index f051176..4c22303 100644 (file)
@@ -1523,14 +1523,12 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
 
   /* make sure that the environnement is clean */
   gst_gl_context_clear_shader (gl_sink->context);
-
+  gl->BindTexture (GL_TEXTURE_2D, 0);
 #if GST_GL_HAVE_OPENGL
   if (USING_OPENGL (gl_sink->context))
     gl->Disable (GL_TEXTURE_2D);
 #endif
 
-  gl->BindTexture (GL_TEXTURE_2D, 0);
-
   sample = gst_sample_new (gl_sink->stored_buffer,
       gl_sink->caps, &GST_BASE_SINK (gl_sink)->segment, NULL);
 
index 726674b..0a98341 100644 (file)
@@ -242,7 +242,6 @@ gst_gl_mosaic_callback (gpointer stuff)
 
   gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
   gl->BindTexture (GL_TEXTURE_2D, 0);
-  gl->Disable (GL_TEXTURE_2D);
 
   gl->Enable (GL_DEPTH_TEST);
 
index 8c8638d..7209621 100644 (file)
@@ -429,10 +429,6 @@ gst_gl_overlay_callback (gint width, gint height, guint texture, gpointer stuff)
   }
 #endif
 
-  if (gst_gl_context_get_gl_api (GST_GL_BASE_FILTER (filter)->context) &
-      GST_GL_API_OPENGL)
-    gl->Enable (GL_TEXTURE_2D);
-
   gl->ActiveTexture (GL_TEXTURE0);
   gl->BindTexture (GL_TEXTURE_2D, texture);
 
index f393137..d27396f 100644 (file)
@@ -911,9 +911,6 @@ gst_gl_video_mixer_callback (gpointer stuff)
 
   gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
   gl->BindTexture (GL_TEXTURE_2D, 0);
-  if (gst_gl_context_get_gl_api (GST_GL_BASE_MIXER (mixer)->context) &
-      GST_GL_API_OPENGL)
-    gl->Disable (GL_TEXTURE_2D);
 
   gl->Disable (GL_DEPTH_TEST);
   gl->Disable (GL_CULL_FACE);
index 5dced6d..11fad7c 100644 (file)
@@ -1134,16 +1134,13 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
     };
 
     gl->ActiveTexture (GL_TEXTURE0);
-
-    gl->Enable (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, texture);
 
-    gl->ClientActiveTexture (GL_TEXTURE0);
-
     gl->EnableClientState (GL_VERTEX_ARRAY);
-    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
-
     gl->VertexPointer (2, GL_FLOAT, 0, &verts);
+
+    gl->ClientActiveTexture (GL_TEXTURE0);
+    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
     gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
     gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
index 901db50..94a5f95 100644 (file)
@@ -173,20 +173,20 @@ draw_render (gpointer data)
     gl->MatrixMode (GL_PROJECTION);
     gl->LoadIdentity ();
 
-    gl->Enable (GL_TEXTURE_2D);
-    gl->BindTexture (GL_TEXTURE_2D, tex);
+    gl->ActiveTexture (GL_TEXTURE_2D);
+    gl->BindTexture (GL_TEXTURE_2D, tex_id);
 
     gl->EnableClientState (GL_VERTEX_ARRAY);
-    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
     gl->VertexPointer (2, GL_FLOAT, 0, &verts);
+
+    gl->ClientActiveTexture (GL_TEXTURE0);
+    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
     gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
     gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
     gl->DisableClientState (GL_VERTEX_ARRAY);
     gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
-
-    gl->Disable (GL_TEXTURE_2D);
   }
 #endif
 #if GST_GL_HAVE_GLES2
index 214d36a..11e2fe0 100644 (file)
@@ -168,20 +168,20 @@ draw_render (gpointer data)
     gl->MatrixMode (GL_PROJECTION);
     gl->LoadIdentity ();
 
-    gl->Enable (GL_TEXTURE_2D);
+    gl->ActiveTexture (GL_TEXTURE_2D);
     gl->BindTexture (GL_TEXTURE_2D, tex_id);
 
     gl->EnableClientState (GL_VERTEX_ARRAY);
-    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
     gl->VertexPointer (2, GL_FLOAT, 0, &verts);
+
+    gl->ClientActiveTexture (GL_TEXTURE0);
+    gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
     gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
     gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
     gl->DisableClientState (GL_VERTEX_ARRAY);
     gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
-
-    gl->Disable (GL_TEXTURE_2D);
   }
 #endif
 #if GST_GL_HAVE_GLES2