Revert "gl: use correct blend functions for unpremultiplied alpha"
authorMatthew Waters <matthew@centricular.com>
Thu, 4 Oct 2018 14:03:09 +0000 (00:03 +1000)
committerMatthew Waters <matthew@centricular.com>
Thu, 4 Oct 2018 14:03:09 +0000 (00:03 +1000)
This reverts commit 779d028f27b7bc6eb7abe841fe2cda97de3be983.

ext/gl/gstglimagesink.c
ext/gl/gstgloverlay.c

index 14e1c95..c70cd55 100644 (file)
@@ -2237,14 +2237,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
 
     if (gl_sink->ignore_alpha) {
       gl->BlendColor (0.0, 0.0, 0.0, alpha);
-      if (gl->BlendFuncSeparate) {
-        gl->BlendFuncSeparate (GL_SRC_ALPHA, GL_CONSTANT_COLOR, GL_ONE,
-            GL_ONE_MINUS_SRC_ALPHA);
-      } else {
-        /* we don't have separate blend modes, perform something close to
-         * correct instead */
-        gl->BlendFunc (GL_SRC_ALPHA, GL_CONSTANT_COLOR);
-      }
+      gl->BlendFunc (GL_SRC_ALPHA, GL_CONSTANT_COLOR);
       gl->BlendEquation (GL_FUNC_ADD);
       gl->Enable (GL_BLEND);
     }
index 59096cb..864ea64 100644 (file)
@@ -530,11 +530,7 @@ gst_gl_overlay_callback (GstGLFilter * filter, GstGLMemory * in_tex,
   gst_gl_shader_set_uniform_1f (overlay->shader, "alpha", overlay->alpha);
 
   gl->Enable (GL_BLEND);
-  if (gl->BlendFuncSeparate)
-    gl->BlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE,
-        GL_ONE_MINUS_SRC_ALPHA);
-  else
-    gl->BlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  gl->BlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   gl->BlendEquation (GL_FUNC_ADD);
 
   gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);