[gnome-shell] st_widget_recompute_style: short-circuit if the theme node is the same



commit 4fc6a804f58ac0a31633a6ad2394e673fcbfa1cc
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Thu Nov 15 15:09:51 2012 +0000

    st_widget_recompute_style: short-circuit if the theme node is the same
    
    It appears to be somewhat common for st_widget_style_changed() to be
    called when no style-relevant attributes have, in fact, changed. Now that
    we cache theme nodes, we're likely to get the same theme node back from
    the cache. If we do, we don't need to waste time asking whether its
    geometry and painting are equal to itself: we can just note that nothing
    really changed and get on with our lives.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687465
    Reviewed-by: Jasper St. Pierre <jstpierre mecheye net>

 src/st/st-widget.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 2a9b8da..b1218d3 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -1532,6 +1532,12 @@ st_widget_recompute_style (StWidget    *widget,
   int transition_duration;
   gboolean paint_equal;
 
+  if (new_theme_node == old_theme_node)
+    {
+      widget->priv->is_style_dirty = FALSE;
+      return;
+    }
+
   if (!old_theme_node ||
       !st_theme_node_geometry_equal (old_theme_node, new_theme_node))
     clutter_actor_queue_relayout ((ClutterActor *) widget);



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