Chromium Code Reviews| 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/AnimationStack.h" | 8 #include "core/animation/AnimationStack.h" |
| 9 #include "core/animation/InertEffect.h" | 9 #include "core/animation/InertEffect.h" |
| 10 #include "core/animation/Interpolation.h" | 10 #include "core/animation/Interpolation.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 Member<InertEffect> effect; | 88 Member<InertEffect> effect; |
| 89 Timing specifiedTiming; | 89 Timing specifiedTiming; |
| 90 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; | 90 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; |
| 91 unsigned styleRuleVersion; | 91 unsigned styleRuleVersion; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class UpdatedAnimationStyle { | 94 class UpdatedAnimationStyle { |
| 95 ALLOW_ONLY_INLINE_ALLOCATION(); | 95 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 96 public: | 96 public: |
| 97 struct CompositableStyleSnapshot { | 97 struct CompositableStyleSnapshot { |
| 98 DISALLOW_ALLOCATION(); | |
|
sof
2015/09/02 13:02:12
Won't do any harm to keep?
| |
| 99 | |
| 100 public: | 98 public: |
| 101 RefPtrWillBeMember<AnimatableValue> opacity; | 99 RefPtr<AnimatableValue> opacity; |
| 102 RefPtrWillBeMember<AnimatableValue> transform; | 100 RefPtr<AnimatableValue> transform; |
| 103 RefPtrWillBeMember<AnimatableValue> webkitFilter; | 101 RefPtr<AnimatableValue> webkitFilter; |
| 104 RefPtrWillBeMember<AnimatableValue> backdropFilter; | 102 RefPtr<AnimatableValue> backdropFilter; |
| 105 | |
| 106 DEFINE_INLINE_TRACE() | |
| 107 { | |
| 108 visitor->trace(opacity); | |
| 109 visitor->trace(transform); | |
| 110 visitor->trace(webkitFilter); | |
| 111 visitor->trace(backdropFilter); | |
| 112 } | |
| 113 }; | 103 }; |
| 114 | 104 |
| 115 UpdatedAnimationStyle() | 105 UpdatedAnimationStyle() |
| 116 { | 106 { |
| 117 } | 107 } |
| 118 | 108 |
| 119 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) | 109 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) |
| 120 : animation(animation) | 110 : animation(animation) |
| 121 , model(model) | 111 , model(model) |
| 122 , snapshot(snapshot) | 112 , snapshot(snapshot) |
| 123 { | 113 { |
| 124 } | 114 } |
| 125 | 115 |
| 126 DEFINE_INLINE_TRACE() | 116 DEFINE_INLINE_TRACE() |
| 127 { | 117 { |
| 128 visitor->trace(animation); | 118 visitor->trace(animation); |
| 129 visitor->trace(model); | 119 visitor->trace(model); |
| 130 visitor->trace(snapshot); | |
| 131 } | 120 } |
| 132 | 121 |
| 133 Member<Animation> animation; | 122 Member<Animation> animation; |
| 134 Member<KeyframeEffectModelBase> model; | 123 Member<KeyframeEffectModelBase> model; |
| 135 CompositableStyleSnapshot snapshot; | 124 CompositableStyleSnapshot snapshot; |
| 136 }; | 125 }; |
| 137 | 126 |
| 138 CSSAnimationUpdate() | 127 CSSAnimationUpdate() |
| 139 { | 128 { |
| 140 } | 129 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 const HeapHashSet<Member<const Animation>>& suppressedAnimations() const { r eturn m_suppressedAnimations; } | 223 const HeapHashSet<Member<const Animation>>& suppressedAnimations() const { r eturn m_suppressedAnimations; } |
| 235 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an imationsWithPauseToggled; } | 224 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an imationsWithPauseToggled; } |
| 236 const HeapVector<UpdatedAnimation>& animationsWithUpdates() const { return m _animationsWithUpdates; } | 225 const HeapVector<UpdatedAnimation>& animationsWithUpdates() const { return m _animationsWithUpdates; } |
| 237 const HeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates() const { return m_animationsWithStyleUpdates; } | 226 const HeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates() const { return m_animationsWithStyleUpdates; } |
| 238 | 227 |
| 239 struct NewTransition { | 228 struct NewTransition { |
| 240 ALLOW_ONLY_INLINE_ALLOCATION(); | 229 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 241 public: | 230 public: |
| 242 DEFINE_INLINE_TRACE() | 231 DEFINE_INLINE_TRACE() |
| 243 { | 232 { |
| 244 visitor->trace(from); | |
| 245 visitor->trace(to); | |
| 246 visitor->trace(effect); | 233 visitor->trace(effect); |
| 247 } | 234 } |
| 248 | 235 |
| 249 CSSPropertyID id; | 236 CSSPropertyID id; |
| 250 RawPtrWillBeMember<const AnimatableValue> from; | 237 const AnimatableValue* from; |
| 251 RawPtrWillBeMember<const AnimatableValue> to; | 238 const AnimatableValue* to; |
| 252 Member<InertEffect> effect; | 239 Member<InertEffect> effect; |
| 253 }; | 240 }; |
| 254 using NewTransitionMap = HeapHashMap<CSSPropertyID, NewTransition>; | 241 using NewTransitionMap = HeapHashMap<CSSPropertyID, NewTransition>; |
| 255 const NewTransitionMap& newTransitions() const { return m_newTransitions; } | 242 const NewTransitionMap& newTransitions() const { return m_newTransitions; } |
| 256 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel ledTransitions; } | 243 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel ledTransitions; } |
| 257 const HashSet<CSSPropertyID>& finishedTransitions() const { return m_finishe dTransitions; } | 244 const HashSet<CSSPropertyID>& finishedTransitions() const { return m_finishe dTransitions; } |
| 258 | 245 |
| 259 void adoptActiveInterpolationsForAnimations(ActiveInterpolationMap& newMap) { newMap.swap(m_activeInterpolationsForAnimations); } | 246 void adoptActiveInterpolationsForAnimations(ActiveInterpolationMap& newMap) { newMap.swap(m_activeInterpolationsForAnimations); } |
| 260 void adoptActiveInterpolationsForTransitions(ActiveInterpolationMap& newMap) { newMap.swap(m_activeInterpolationsForTransitions); } | 247 void adoptActiveInterpolationsForTransitions(ActiveInterpolationMap& newMap) { newMap.swap(m_activeInterpolationsForTransitions); } |
| 261 const ActiveInterpolationMap& activeInterpolationsForAnimations() const { re turn m_activeInterpolationsForAnimations; } | 248 const ActiveInterpolationMap& activeInterpolationsForAnimations() const { re turn m_activeInterpolationsForAnimations; } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 273 && m_newTransitions.isEmpty() | 260 && m_newTransitions.isEmpty() |
| 274 && m_cancelledTransitions.isEmpty() | 261 && m_cancelledTransitions.isEmpty() |
| 275 && m_finishedTransitions.isEmpty() | 262 && m_finishedTransitions.isEmpty() |
| 276 && m_activeInterpolationsForAnimations.isEmpty() | 263 && m_activeInterpolationsForAnimations.isEmpty() |
| 277 && m_activeInterpolationsForTransitions.isEmpty(); | 264 && m_activeInterpolationsForTransitions.isEmpty(); |
| 278 } | 265 } |
| 279 | 266 |
| 280 DEFINE_INLINE_TRACE() | 267 DEFINE_INLINE_TRACE() |
| 281 { | 268 { |
| 282 visitor->trace(m_newTransitions); | 269 visitor->trace(m_newTransitions); |
| 283 #if ENABLE(OILPAN) | |
| 284 visitor->trace(m_activeInterpolationsForAnimations); | |
| 285 visitor->trace(m_activeInterpolationsForTransitions); | |
| 286 #endif | |
| 287 visitor->trace(m_newAnimations); | 270 visitor->trace(m_newAnimations); |
| 288 visitor->trace(m_suppressedAnimations); | 271 visitor->trace(m_suppressedAnimations); |
| 289 visitor->trace(m_animationsWithUpdates); | 272 visitor->trace(m_animationsWithUpdates); |
| 290 visitor->trace(m_animationsWithStyleUpdates); | 273 visitor->trace(m_animationsWithStyleUpdates); |
| 291 } | 274 } |
| 292 | 275 |
| 293 private: | 276 private: |
| 294 // Order is significant since it defines the order in which new animations | 277 // Order is significant since it defines the order in which new animations |
| 295 // will be started. Note that there may be multiple animations present | 278 // will be started. Note that there may be multiple animations present |
| 296 // with the same name, due to the way in which we split up animations with | 279 // with the same name, due to the way in which we split up animations with |
| 297 // incomplete keyframes. | 280 // incomplete keyframes. |
| 298 HeapVector<NewAnimation> m_newAnimations; | 281 HeapVector<NewAnimation> m_newAnimations; |
| 299 Vector<AtomicString> m_cancelledAnimationNames; | 282 Vector<AtomicString> m_cancelledAnimationNames; |
| 300 HeapHashSet<Member<const Animation>> m_suppressedAnimations; | 283 HeapHashSet<Member<const Animation>> m_suppressedAnimations; |
| 301 Vector<AtomicString> m_animationsWithPauseToggled; | 284 Vector<AtomicString> m_animationsWithPauseToggled; |
| 302 HeapVector<UpdatedAnimation> m_animationsWithUpdates; | 285 HeapVector<UpdatedAnimation> m_animationsWithUpdates; |
| 303 HeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; | 286 HeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; |
| 304 | 287 |
| 305 NewTransitionMap m_newTransitions; | 288 NewTransitionMap m_newTransitions; |
| 306 HashSet<CSSPropertyID> m_cancelledTransitions; | 289 HashSet<CSSPropertyID> m_cancelledTransitions; |
| 307 HashSet<CSSPropertyID> m_finishedTransitions; | 290 HashSet<CSSPropertyID> m_finishedTransitions; |
| 308 | 291 |
| 309 ActiveInterpolationMap m_activeInterpolationsForAnimations; | 292 ActiveInterpolationMap m_activeInterpolationsForAnimations; |
| 310 ActiveInterpolationMap m_activeInterpolationsForTransitions; | 293 ActiveInterpolationMap m_activeInterpolationsForTransitions; |
| 294 | |
| 295 friend class PendingAnimationUpdate; | |
| 311 }; | 296 }; |
| 312 | 297 |
| 313 } // namespace blink | 298 } // namespace blink |
| 314 | 299 |
| 315 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 300 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
| 316 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 301 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
| 317 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty le); | 302 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty le); |
| 318 | 303 |
| 319 #endif | 304 #endif |
| OLD | NEW |