| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSAnimationUpdate_h | 5 #ifndef CSSAnimationUpdate_h |
| 6 #define CSSAnimationUpdate_h | 6 #define CSSAnimationUpdate_h |
| 7 | 7 |
| 8 #include "core/animation/Interpolation.h" | 8 #include "core/animation/Interpolation.h" |
| 9 #include "core/animation/KeyframeEffectModel.h" | 9 #include "core/animation/KeyframeEffectModel.h" |
| 10 #include "core/animation/css/CSSAnimatableValueFactory.h" | 10 #include "core/animation/css/CSSAnimatableValueFactory.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 NewAnimation(AtomicString name, PassRefPtrWillBeRawPtr<InertAnimation> a
nimation, Timing timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) | 35 NewAnimation(AtomicString name, PassRefPtrWillBeRawPtr<InertAnimation> a
nimation, Timing timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) |
| 36 : name(name) | 36 : name(name) |
| 37 , animation(animation) | 37 , animation(animation) |
| 38 , timing(timing) | 38 , timing(timing) |
| 39 , styleRule(styleRule) | 39 , styleRule(styleRule) |
| 40 , styleRuleVersion(this->styleRule->version()) | 40 , styleRuleVersion(this->styleRule->version()) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 void trace(Visitor* visitor) | 44 DEFINE_INLINE_TRACE() |
| 45 { | 45 { |
| 46 visitor->trace(animation); | 46 visitor->trace(animation); |
| 47 visitor->trace(styleRule); | 47 visitor->trace(styleRule); |
| 48 } | 48 } |
| 49 | 49 |
| 50 AtomicString name; | 50 AtomicString name; |
| 51 RefPtrWillBeMember<InertAnimation> animation; | 51 RefPtrWillBeMember<InertAnimation> animation; |
| 52 Timing timing; | 52 Timing timing; |
| 53 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; | 53 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; |
| 54 unsigned styleRuleVersion; | 54 unsigned styleRuleVersion; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 65 UpdatedAnimation(AtomicString name, AnimationPlayer* player, PassRefPtrW
illBeRawPtr<InertAnimation> animation, Timing specifiedTiming, PassRefPtrWillBeR
awPtr<StyleRuleKeyframes> styleRule) | 65 UpdatedAnimation(AtomicString name, AnimationPlayer* player, PassRefPtrW
illBeRawPtr<InertAnimation> animation, Timing specifiedTiming, PassRefPtrWillBeR
awPtr<StyleRuleKeyframes> styleRule) |
| 66 : name(name) | 66 : name(name) |
| 67 , player(player) | 67 , player(player) |
| 68 , animation(animation) | 68 , animation(animation) |
| 69 , specifiedTiming(specifiedTiming) | 69 , specifiedTiming(specifiedTiming) |
| 70 , styleRule(styleRule) | 70 , styleRule(styleRule) |
| 71 , styleRuleVersion(this->styleRule->version()) | 71 , styleRuleVersion(this->styleRule->version()) |
| 72 { | 72 { |
| 73 } | 73 } |
| 74 | 74 |
| 75 void trace(Visitor* visitor) | 75 DEFINE_INLINE_TRACE() |
| 76 { | 76 { |
| 77 visitor->trace(player); | 77 visitor->trace(player); |
| 78 visitor->trace(animation); | 78 visitor->trace(animation); |
| 79 visitor->trace(styleRule); | 79 visitor->trace(styleRule); |
| 80 } | 80 } |
| 81 | 81 |
| 82 AtomicString name; | 82 AtomicString name; |
| 83 RawPtrWillBeMember<AnimationPlayer> player; | 83 RawPtrWillBeMember<AnimationPlayer> player; |
| 84 RefPtrWillBeMember<InertAnimation> animation; | 84 RefPtrWillBeMember<InertAnimation> animation; |
| 85 Timing specifiedTiming; | 85 Timing specifiedTiming; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 110 { | 110 { |
| 111 } | 111 } |
| 112 | 112 |
| 113 UpdatedAnimationStyle(AnimationPlayer* player, KeyframeEffectModelBase*
effect, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) | 113 UpdatedAnimationStyle(AnimationPlayer* player, KeyframeEffectModelBase*
effect, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) |
| 114 : player(player) | 114 : player(player) |
| 115 , effect(effect) | 115 , effect(effect) |
| 116 , snapshot(snapshot) | 116 , snapshot(snapshot) |
| 117 { | 117 { |
| 118 } | 118 } |
| 119 | 119 |
| 120 void trace(Visitor* visitor) | 120 DEFINE_INLINE_TRACE() |
| 121 { | 121 { |
| 122 visitor->trace(player); | 122 visitor->trace(player); |
| 123 visitor->trace(effect); | 123 visitor->trace(effect); |
| 124 visitor->trace(snapshot); | 124 visitor->trace(snapshot); |
| 125 } | 125 } |
| 126 | 126 |
| 127 RawPtrWillBeMember<AnimationPlayer> player; | 127 RawPtrWillBeMember<AnimationPlayer> player; |
| 128 RawPtrWillBeMember<KeyframeEffectModelBase> effect; | 128 RawPtrWillBeMember<KeyframeEffectModelBase> effect; |
| 129 CompositableStyleSnapshot snapshot; | 129 CompositableStyleSnapshot snapshot; |
| 130 }; | 130 }; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 const WillBeHeapVector<NewAnimation>& newAnimations() const { return m_newAn
imations; } | 185 const WillBeHeapVector<NewAnimation>& newAnimations() const { return m_newAn
imations; } |
| 186 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } | 186 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } |
| 187 const WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>>& suppress
edAnimationAnimationPlayers() const { return m_suppressedAnimationPlayers; } | 187 const WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>>& suppress
edAnimationAnimationPlayers() const { return m_suppressedAnimationPlayers; } |
| 188 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } | 188 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } |
| 189 const WillBeHeapVector<UpdatedAnimation>& animationsWithUpdates() const { re
turn m_animationsWithUpdates; } | 189 const WillBeHeapVector<UpdatedAnimation>& animationsWithUpdates() const { re
turn m_animationsWithUpdates; } |
| 190 const WillBeHeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates()
const { return m_animationsWithStyleUpdates; } | 190 const WillBeHeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates()
const { return m_animationsWithStyleUpdates; } |
| 191 | 191 |
| 192 struct NewTransition { | 192 struct NewTransition { |
| 193 ALLOW_ONLY_INLINE_ALLOCATION(); | 193 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 194 public: | 194 public: |
| 195 void trace(Visitor* visitor) | 195 DEFINE_INLINE_TRACE() |
| 196 { | 196 { |
| 197 visitor->trace(from); | 197 visitor->trace(from); |
| 198 visitor->trace(to); | 198 visitor->trace(to); |
| 199 visitor->trace(animation); | 199 visitor->trace(animation); |
| 200 } | 200 } |
| 201 | 201 |
| 202 CSSPropertyID id; | 202 CSSPropertyID id; |
| 203 CSSPropertyID eventId; | 203 CSSPropertyID eventId; |
| 204 RawPtrWillBeMember<const AnimatableValue> from; | 204 RawPtrWillBeMember<const AnimatableValue> from; |
| 205 RawPtrWillBeMember<const AnimatableValue> to; | 205 RawPtrWillBeMember<const AnimatableValue> to; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 224 && m_animationsWithPauseToggled.isEmpty() | 224 && m_animationsWithPauseToggled.isEmpty() |
| 225 && m_animationsWithUpdates.isEmpty() | 225 && m_animationsWithUpdates.isEmpty() |
| 226 && m_animationsWithStyleUpdates.isEmpty() | 226 && m_animationsWithStyleUpdates.isEmpty() |
| 227 && m_newTransitions.isEmpty() | 227 && m_newTransitions.isEmpty() |
| 228 && m_cancelledTransitions.isEmpty() | 228 && m_cancelledTransitions.isEmpty() |
| 229 && m_finishedTransitions.isEmpty() | 229 && m_finishedTransitions.isEmpty() |
| 230 && m_activeInterpolationsForAnimations.isEmpty() | 230 && m_activeInterpolationsForAnimations.isEmpty() |
| 231 && m_activeInterpolationsForTransitions.isEmpty(); | 231 && m_activeInterpolationsForTransitions.isEmpty(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void trace(Visitor*); | 234 DECLARE_TRACE(); |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 // Order is significant since it defines the order in which new animations | 237 // Order is significant since it defines the order in which new animations |
| 238 // will be started. Note that there may be multiple animations present | 238 // will be started. Note that there may be multiple animations present |
| 239 // with the same name, due to the way in which we split up animations with | 239 // with the same name, due to the way in which we split up animations with |
| 240 // incomplete keyframes. | 240 // incomplete keyframes. |
| 241 WillBeHeapVector<NewAnimation> m_newAnimations; | 241 WillBeHeapVector<NewAnimation> m_newAnimations; |
| 242 Vector<AtomicString> m_cancelledAnimationNames; | 242 Vector<AtomicString> m_cancelledAnimationNames; |
| 243 WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> m_suppressedAni
mationPlayers; | 243 WillBeHeapHashSet<RawPtrWillBeMember<const AnimationPlayer>> m_suppressedAni
mationPlayers; |
| 244 Vector<AtomicString> m_animationsWithPauseToggled; | 244 Vector<AtomicString> m_animationsWithPauseToggled; |
| 245 WillBeHeapVector<UpdatedAnimation> m_animationsWithUpdates; | 245 WillBeHeapVector<UpdatedAnimation> m_animationsWithUpdates; |
| 246 WillBeHeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; | 246 WillBeHeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; |
| 247 | 247 |
| 248 NewTransitionMap m_newTransitions; | 248 NewTransitionMap m_newTransitions; |
| 249 HashSet<CSSPropertyID> m_cancelledTransitions; | 249 HashSet<CSSPropertyID> m_cancelledTransitions; |
| 250 HashSet<CSSPropertyID> m_finishedTransitions; | 250 HashSet<CSSPropertyID> m_finishedTransitions; |
| 251 | 251 |
| 252 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForAnimations; | 252 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForAnimations; |
| 253 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForTransitions; | 253 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForTransitions; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 } // namespace blink | 256 } // namespace blink |
| 257 | 257 |
| 258 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 258 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
| 259 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 259 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
| 260 | 260 |
| 261 #endif | 261 #endif |
| OLD | NEW |