[gtk+] snapshot: Don't create blur nodes with radius 0



commit 329683f74662aeb60bad3e4c93bb91dcb5c2e5b3
Author: Timm Bäder <mail baedert org>
Date:   Fri Dec 8 16:58:06 2017 +0100

    snapshot: Don't create blur nodes with radius 0

 gtk/gtksnapshot.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index a9882db..ac18bb5 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -346,12 +346,18 @@ gtk_snapshot_collect_blur (GtkSnapshot      *snapshot,
                            const char     *name)
 {
   GskRenderNode *node, *blur_node;
+  double radius;
 
   node = gtk_snapshot_collect_default (snapshot, state, nodes, n_nodes, name);
   if (node == NULL)
     return NULL;
 
-  blur_node = gsk_blur_node_new (node, state->data.blur.radius);
+  radius = state->data.blur.radius;
+
+  if (radius == 0.0)
+    return node;
+
+  blur_node = gsk_blur_node_new (node, radius);
   if (name)
     gsk_render_node_set_name (blur_node, name);
 


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