[gtk/wip/baedert/for-master] gl renderer: return empty texture for too small blurred nodes



commit 09b3df1b3f7166793e196719cac6f648ff8cd8d5
Author: Timm Bäder <mail baedert org>
Date:   Sat Oct 10 19:39:33 2020 +0200

    gl renderer: return empty texture for too small blurred nodes

 gsk/gl/gskglrenderer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index ae64a0f76b..58943ab44b 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1798,10 +1798,15 @@ blur_texture (GskGLRenderer       *self,
   g_assert (blur_radius > 0);
 
   gsk_gl_driver_create_render_target (self->gl_driver,
-                                      texture_to_blur_width, texture_to_blur_height,
+                                      MAX (texture_to_blur_width, 1), MAX (texture_to_blur_height, 1),
                                       GL_NEAREST, GL_NEAREST,
                                       &pass1_texture_id, &pass1_render_target);
 
+  if (texture_to_blur_width <= 0 || texture_to_blur_height <= 0)
+    {
+      return pass1_texture_id;
+    }
+
   gsk_gl_driver_create_render_target (self->gl_driver,
                                       texture_to_blur_width, texture_to_blur_height,
                                       GL_NEAREST, GL_NEAREST,


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