Split animations and transitions into separate lists

This change splits the list of animations and transitions, which are
almost always handled differently. It also renames
`ElementAnimationState` to `ElementAnimationSet` and establishes an
`AnimationState` for every transition and animation. This allows us to
stop continually reallocating lists every time a transition or animation
needs to be canceled.

Fixes #14419.
This commit is contained in:
Martin Robinson 2020-05-06 14:57:23 +02:00
parent b290ad95c1
commit b8874ad6ac
5 changed files with 670 additions and 692 deletions

View file

@ -452,15 +452,15 @@ trait PrivateMatchMethods: TElement {
&context.thread_local.font_metrics_provider,
);
animation_state.apply_new_and_running_animations::<Self>(
animation_state.apply_active_animations::<Self>(
shared_context,
new_values,
&context.thread_local.font_metrics_provider,
);
// If the ElementAnimationState is empty, and don't store it in order to
// If the ElementAnimationSet is empty, and don't store it in order to
// save memory and to avoid extra processing later.
animation_state.finished_animations.clear();
animation_state.clear_finished_animations();
if !animation_state.is_empty() {
animation_states.insert(this_opaque, animation_state);
}