Notice style transitions that don't change how StThemeNode paints

Add st_theme_node_paint_equal() and use that to do two things:

 1) Avoid animating transitions where nothing changes.
 2) Copy cached painting state from the old theme node to the new
    theme node.

https://bugzilla.gnome.org/show_bug.cgi?id=627083
This commit is contained in:
Owen W. Taylor
2010-08-26 14:10:46 -04:00
parent b9f9dd948a
commit 5e7c25e136
9 changed files with 210 additions and 3 deletions

View File

@ -165,9 +165,16 @@ st_theme_node_transition_update (StThemeNodeTransition *transition,
guint new_duration = st_theme_node_get_transition_duration (new_node);
clutter_timeline_set_duration (priv->timeline, new_duration);
/* If the change doesn't affect painting, we don't need to redraw,
* but we still need to replace the node so that we properly share
* caching with the painting that happens after the transition finishes.
*/
if (!st_theme_node_paint_equal (priv->new_theme_node, new_node))
priv->needs_setup = TRUE;
g_object_unref (priv->new_theme_node);
priv->new_theme_node = g_object_ref (new_node);
priv->needs_setup = TRUE;
}
}
}