[gtk/matthiasc/for-master: 3/3] gsk: Fall back to cairo if compiling shaders fails



commit 9eccc45de34ff44519eed4868c89081fcbdb8ff3
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 17 12:35:37 2020 -0400

    gsk: Fall back to cairo if compiling shaders fails
    
    There was already some fallback in place here, but
    in other places we were just asserting.

 gsk/gl/gskglrenderer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index a706f0c18e..c1fa55c2dd 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -50,7 +50,11 @@
               G_STMT_START{\
                 programs->program_name ## _program.program_name.uniform_basename ## _location = \
                               glGetUniformLocation(programs->program_name ## _program.id, "u_" 
#uniform_basename);\
-                g_assert_cmpint (programs->program_name ## _program.program_name.uniform_basename ## 
_location, >, -1); \
+                if (programs->program_name ## _program.program_name.uniform_basename ## _location == -1) \
+                  { \
+                    g_clear_pointer (&programs, gsk_gl_renderer_programs_unref); \
+                    goto out; \
+                  } \
               }G_STMT_END
 
 #define INIT_COMMON_UNIFORM_LOCATION(program_ptr, uniform_basename) \


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