[gtk] gl renderer: Initialize alpha uniform to 1.0



commit 06f63764fbc279120778d3b29833626b74a7a234
Author: Timm Bäder <mail baedert org>
Date:   Mon Dec 16 06:29:01 2019 +0100

    gl renderer: Initialize alpha uniform to 1.0
    
    This makes gl-legacy work and gl-gles work except for text and icons.

 gsk/gl/gskglrenderer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index ee52e72c77..b64338a919 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -2791,6 +2791,16 @@ gsk_gl_renderer_create_programs (GskGLRenderer  *self,
   INIT_PROGRAM_UNIFORM_LOCATION (repeat, child_bounds);
   INIT_PROGRAM_UNIFORM_LOCATION (repeat, texture_rect);
 
+
+  /* We initialize the alpha uniform here, since the default value is important.
+   * We can't do it in the shader like a resonable person would because that doesn't
+   * work in gles. */
+  for (i = 0; i < GL_N_PROGRAMS; i++)
+    {
+      glUseProgram(self->programs[i].id);
+      glUniform1f (self->programs[i].alpha_location, 1.0);
+    }
+
 out:
   gsk_gl_shader_builder_finish (&shader_builder);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]