mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -5,7 +5,7 @@
|
|||
//! The context within which style is calculated.
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
use crate::animation::ElementAnimationState;
|
||||
use crate::animation::ElementAnimationSet;
|
||||
use crate::bloom::StyleBloom;
|
||||
use crate::data::{EagerPseudoStyles, ElementData};
|
||||
#[cfg(feature = "servo")]
|
||||
|
@ -167,7 +167,7 @@ pub struct SharedStyleContext<'a> {
|
|||
|
||||
/// The state of all animations for our styled elements.
|
||||
#[cfg(feature = "servo")]
|
||||
pub animation_states: Arc<RwLock<FxHashMap<OpaqueNode, ElementAnimationState>>>,
|
||||
pub animation_states: Arc<RwLock<FxHashMap<OpaqueNode, ElementAnimationSet>>>,
|
||||
|
||||
/// Paint worklets
|
||||
#[cfg(feature = "servo")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue