Revert "gl: use correct blend functions for unpremultiplied alpha"

This reverts commit 779d028f27.
This commit is contained in:
Matthew Waters 2018-10-05 00:03:09 +10:00
parent 779d028f27
commit 452d90a88c
2 changed files with 2 additions and 13 deletions

View file

@ -2237,14 +2237,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
if (gl_sink->ignore_alpha) { if (gl_sink->ignore_alpha) {
gl->BlendColor (0.0, 0.0, 0.0, alpha); gl->BlendColor (0.0, 0.0, 0.0, alpha);
if (gl->BlendFuncSeparate) { gl->BlendFunc (GL_SRC_ALPHA, GL_CONSTANT_COLOR);
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->BlendEquation (GL_FUNC_ADD); gl->BlendEquation (GL_FUNC_ADD);
gl->Enable (GL_BLEND); gl->Enable (GL_BLEND);
} }

View 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); gst_gl_shader_set_uniform_1f (overlay->shader, "alpha", overlay->alpha);
gl->Enable (GL_BLEND); gl->Enable (GL_BLEND);
if (gl->BlendFuncSeparate) gl->BlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
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->BlendEquation (GL_FUNC_ADD); gl->BlendEquation (GL_FUNC_ADD);
gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);