gl renderer: Fix blur nodes with radius 0
authorTimm Bäder <mail@baedert.org>
Tue, 7 May 2019 15:20:11 +0000 (17:20 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 7 May 2019 15:21:16 +0000 (17:21 +0200)
gsk/gl/gskglrenderer.c

index 6a5c0984657e427a2eacf7c03f21882325b28391..29e8172aa50ef20e3d59f91686b2133f799020e8 100644 (file)
@@ -1268,10 +1268,17 @@ render_blur_node (GskGLRenderer       *self,
   const float min_y = builder->dy + node->bounds.origin.y;
   const float max_x = min_x + node->bounds.size.width;
   const float max_y = min_y + node->bounds.size.height;
+  const float blur_radius = gsk_blur_node_get_radius (node);
   int texture_id;
   gboolean is_offscreen;
   RenderOp op;
 
+  if (blur_radius <= 0)
+    {
+      gsk_gl_renderer_add_render_ops (self, gsk_blur_node_get_child (node), builder);
+      return;
+    }
+
   /* TODO(perf): We're forcing the child offscreen even if it's a texture
    * so the resulting offscreen texture is bigger by the gaussian blur factor
    * (see gsk_blur_node_new), but we didn't have to do that if the blur