Fix window holes behind transparent objects

Without this change, the transparent objects composed over the opaque
background creates the transparency of the entire window through which
the desktop wallpaper could be seen.
This problem manifested itself with glow backend and wayland compositor
(gnome).

This patch completely eliminates this problem. With it, the final image
produced by glow backend corresponds to the image produced by the wgpu
backend.

Fixes #1018
This commit is contained in:
Ildar Akhmetgaleev 2021-09-02 19:38:41 +07:00
parent 7ebdbec8e7
commit 666f676d7c

View file

@ -26,7 +26,12 @@ impl iced_graphics::window::GLCompositor for Compositor {
// Enable alpha blending
gl.enable(glow::BLEND);
gl.blend_func(glow::SRC_ALPHA, glow::ONE_MINUS_SRC_ALPHA);
gl.blend_func_separate(
glow::SRC_ALPHA,
glow::ONE_MINUS_SRC_ALPHA,
glow::ONE,
glow::ONE_MINUS_SRC_ALPHA,
);
// Disable multisampling by default
gl.disable(glow::MULTISAMPLE);