mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
Revert "Revert "gl: use correct blend functions for unpremultiplied alpha""
This reverts commit 452d90a88c
.
This was actually correct. sorry for the noise!
This commit is contained in:
parent
6e591403a7
commit
a164d86804
2 changed files with 13 additions and 2 deletions
|
@ -2250,7 +2250,14 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
|
|||
|
||||
if (gl_sink->ignore_alpha) {
|
||||
gl->BlendColor (0.0, 0.0, 0.0, alpha);
|
||||
gl->BlendFunc (GL_SRC_ALPHA, GL_CONSTANT_COLOR);
|
||||
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->BlendEquation (GL_FUNC_ADD);
|
||||
gl->Enable (GL_BLEND);
|
||||
}
|
||||
|
|
|
@ -530,7 +530,11 @@ gst_gl_overlay_callback (GstGLFilter * filter, GstGLMemory * in_tex,
|
|||
gst_gl_shader_set_uniform_1f (overlay->shader, "alpha", overlay->alpha);
|
||||
|
||||
gl->Enable (GL_BLEND);
|
||||
gl->BlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
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->BlendEquation (GL_FUNC_ADD);
|
||||
|
||||
gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
|
||||
|
|
Loading…
Reference in a new issue