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>
This commit is contained in:
Simon McVittie 2012-11-15 15:09:51 +00:00
parent 08d2ca300a
commit 4fc6a804f5

View File

@ -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);