mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
b290ad95c1
commit
b8874ad6ac
5 changed files with 670 additions and 692 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue