Chromium Code Reviews| Index: Source/core/animation/css/CSSAnimationUpdate.h |
| diff --git a/Source/core/animation/css/CSSAnimationUpdate.h b/Source/core/animation/css/CSSAnimationUpdate.h |
| index 9ae2286f746dbd4b4e787f1ce25a9d8346e814a7..d9809636dad6ba3babe72176fe9717b56f17d567 100644 |
| --- a/Source/core/animation/css/CSSAnimationUpdate.h |
| +++ b/Source/core/animation/css/CSSAnimationUpdate.h |
| @@ -6,6 +6,7 @@ |
| #define CSSAnimationUpdate_h |
| #include "core/animation/Interpolation.h" |
| +#include "core/css/CSSKeyframesRule.h" |
| #include "wtf/HashMap.h" |
| #include "wtf/Vector.h" |
| #include "wtf/text/AtomicString.h" |
| @@ -19,12 +20,15 @@ class InertAnimation; |
| // This includes updates to animations/transitions as well as the Interpolations to be applied. |
| class CSSAnimationUpdate final : public NoBaseWillBeGarbageCollectedFinalized<CSSAnimationUpdate> { |
| public: |
| - void startAnimation(const AtomicString& animationName, PassRefPtrWillBeRawPtr<InertAnimation> animation) |
| + void startAnimation(const AtomicString& animationName, PassRefPtrWillBeRawPtr<InertAnimation> animation, const Timing& timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) |
| { |
| animation->setName(animationName); |
| NewAnimation newAnimation; |
| newAnimation.name = animationName; |
| newAnimation.animation = animation; |
| + newAnimation.timing = timing; |
| + newAnimation.styleChangeCounter = styleRule->styleChangeCounter(); |
| + newAnimation.styleRule = styleRule; |
| m_newAnimations.append(newAnimation); |
| } |
| // Returns whether player has been suppressed and should be filtered during style application. |
| @@ -38,13 +42,17 @@ public: |
| { |
| m_animationsWithPauseToggled.append(name); |
| } |
| - void updateAnimationTiming(AnimationPlayer* player, PassRefPtrWillBeRawPtr<InertAnimation> animation, const Timing& timing) |
| + void updateAnimation(const AtomicString& name, AnimationPlayer* player, PassRefPtrWillBeRawPtr<InertAnimation> animation, const Timing& specifiedTiming, |
| + PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) |
| { |
| - UpdatedAnimationTiming updatedAnimation; |
| + UpdatedAnimation updatedAnimation; |
| + updatedAnimation.name = name; |
| updatedAnimation.player = player; |
| updatedAnimation.animation = animation; |
| - updatedAnimation.newTiming = timing; |
| - m_animationsWithTimingUpdates.append(updatedAnimation); |
| + updatedAnimation.specifiedTiming = specifiedTiming; |
| + updatedAnimation.styleChangeCounter = styleRule->styleChangeCounter(); |
| + updatedAnimation.styleRule = styleRule; |
| + m_animationsWithUpdates.append(updatedAnimation); |
| m_suppressedAnimationPlayers.add(player); |
| } |
| @@ -72,27 +80,34 @@ public: |
| AtomicString name; |
| RefPtrWillBeMember<InertAnimation> animation; |
| + Timing timing; |
| + RefPtrWillBeMember<StyleRuleKeyframes> styleRule; |
| + unsigned styleChangeCounter; |
|
esprehn
2015/01/29 04:23:19
zero init.
shend
2015/01/30 00:03:10
Done.
|
| }; |
| - struct UpdatedAnimationTiming { |
| + struct UpdatedAnimation { |
| ALLOW_ONLY_INLINE_ALLOCATION(); |
| public: |
| void trace(Visitor* visitor) |
| { |
| visitor->trace(player); |
| visitor->trace(animation); |
| + visitor->trace(styleRule); |
| } |
| + AtomicString name; |
| RawPtrWillBeMember<AnimationPlayer> player; |
| RefPtrWillBeMember<InertAnimation> animation; |
| - Timing newTiming; |
| + Timing specifiedTiming; |
| + RefPtrWillBeMember<StyleRuleKeyframes> styleRule; |
| + unsigned styleChangeCounter; |
|
esprehn
2015/01/29 04:23:19
zero init.
shend
2015/01/30 00:03:10
Done.
|
| }; |
| const WillBeHeapVector<NewAnimation>& newAnimations() const { return m_newAnimations; } |
| const Vector<AtomicString>& cancelledAnimationNames() const { return m_cancelledAnimationNames; } |
| const WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>>& suppressedAnimationAnimationPlayers() const { return m_suppressedAnimationPlayers; } |
| const Vector<AtomicString>& animationsWithPauseToggled() const { return m_animationsWithPauseToggled; } |
| - const WillBeHeapVector<UpdatedAnimationTiming>& animationsWithTimingUpdates() const { return m_animationsWithTimingUpdates; } |
| + const WillBeHeapVector<UpdatedAnimation>& animationsWithUpdates() const { return m_animationsWithUpdates; } |
| struct NewTransition { |
| ALLOW_ONLY_INLINE_ALLOCATION(); |
| @@ -126,7 +141,7 @@ public: |
| && m_cancelledAnimationNames.isEmpty() |
| && m_suppressedAnimationPlayers.isEmpty() |
| && m_animationsWithPauseToggled.isEmpty() |
| - && m_animationsWithTimingUpdates.isEmpty() |
| + && m_animationsWithUpdates.isEmpty() |
| && m_newTransitions.isEmpty() |
| && m_cancelledTransitions.isEmpty() |
| && m_activeInterpolationsForAnimations.isEmpty() |
| @@ -144,7 +159,7 @@ private: |
| Vector<AtomicString> m_cancelledAnimationNames; |
| WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> m_suppressedAnimationPlayers; |
| Vector<AtomicString> m_animationsWithPauseToggled; |
| - WillBeHeapVector<UpdatedAnimationTiming> m_animationsWithTimingUpdates; |
| + WillBeHeapVector<UpdatedAnimation> m_animationsWithUpdates; |
| NewTransitionMap m_newTransitions; |
| HashSet<CSSPropertyID> m_cancelledTransitions; |
| @@ -156,6 +171,6 @@ private: |
| } // namespace blink |
| WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
| -WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationTiming); |
| +WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
| #endif |