diff options
author | wm4 <wm4@nowhere> | 2013-11-10 03:14:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-10 03:14:38 +0100 |
commit | 775e08ba656baab77b245536f4d3aaebde503279 (patch) | |
tree | ddcfb846ce6f9c039ab735a009905c296ecd3a6e /sub/dec_sub.h | |
parent | 9e40d7155c822a5a7041144f0236412a0fa41134 (diff) | |
download | mpv-775e08ba656baab77b245536f4d3aaebde503279.tar.bz2 mpv-775e08ba656baab77b245536f4d3aaebde503279.tar.xz |
vo_opengl: fix alpha values written to the framebuffer
When blending OSD and subtitles onto the video, we write bogus alpha
values. This doesn't normally matter, because these values are normally
unused and discarded. But at least on Wayland, the alpha values are used
by the compositor and leads to transparent windows even with opaque
video on places where the OSD happens to use transparency.
(Also see github issue #338.)
Until now, the alpha basically contained garbage. The source factor
GL_SRC_ALPHA meant that alpha was multiplied with itself. Use GL_ONE
instead (which is why we have to use glBlendFuncSeparate()). This should
give correct results, even with video that has alpha. (Or at least it's
something close to correct, I haven't thought too hard how the
compositor will blend it, and in fact I couldn't manage to test it.)
If glBlendFuncSeparate() is not available, fall back to glBlendFunc(),
which does the same as the code did before this commit. Technically, we
support GL 1.1, but glBlendFuncSeparate is 1.4, and I guess we should
try not to crash if vo_opengl_old runs on a system with GL 1.1 drivers
only.
Diffstat (limited to 'sub/dec_sub.h')
0 files changed, 0 insertions, 0 deletions