[client] egl: create 24-bit colour context

This should prevent the looking-glass-client window from having an alpha
channel. On Wayland, the alpha channel is used to compose the window onto
the desktop, so the wallpaper would bleed through unless set to complete
opaque.

We worked around this by using constant alpha for rendering, but it was
not sustainable. Instead, we should just ask for 24-bit context.
This commit is contained in:
Quantum 2021-01-30 23:56:12 -05:00 committed by Geoffrey McRae
parent 5454053d96
commit 2993f7ae7d
3 changed files with 3 additions and 6 deletions

View File

@ -518,7 +518,7 @@ bool egl_render_startup(void * opaque)
EGLint attr[] = EGLint attr[] =
{ {
EGL_BUFFER_SIZE , 32, EGL_BUFFER_SIZE , 24,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_SAMPLE_BUFFERS , maxSamples > 0 ? 1 : 0, EGL_SAMPLE_BUFFERS , maxSamples > 0 ? 1 : 0,
EGL_SAMPLES , maxSamples, EGL_SAMPLES , maxSamples,

View File

@ -186,8 +186,7 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
return; return;
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendColor(0, 0, 0, 0.5); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
// render the background first // render the background first
egl_shader_use(help->shaderBG); egl_shader_use(help->shaderBG);
@ -195,8 +194,6 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
glUniform2f(help->uSizeBG , help->width, help->height); glUniform2f(help->uSizeBG , help->width, help->height);
egl_model_render(help->model); egl_model_render(help->model);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// render the texture over the background // render the texture over the background
egl_shader_use(help->shader); egl_shader_use(help->shader);
glUniform2f(help->uScreen, scaleX , scaleY ); glUniform2f(help->uScreen, scaleX , scaleY );

View File

@ -4,5 +4,5 @@ out highp vec4 color;
void main() void main()
{ {
color = vec4(0.0, 0.0, 1.0, 1.0); color = vec4(0.0, 0.0, 1.0, 0.5);
} }