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 RefPtrWillBeMember<InertEffect> effect; | 88 RefPtrWillBeMember<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(); | |
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 | |
105 DEFINE_INLINE_TRACE() | |
106 { | |
107 visitor->trace(opacity); | |
108 visitor->trace(transform); | |
109 visitor->trace(webkitFilter); | |
110 } | |
111 }; | 102 }; |
112 | 103 |
113 UpdatedAnimationStyle() | 104 UpdatedAnimationStyle() |
114 { | 105 { |
115 } | 106 } |
116 | 107 |
117 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod
el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) | 108 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod
el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) |
118 : animation(animation) | 109 : animation(animation) |
119 , model(model) | 110 , model(model) |
120 , snapshot(snapshot) | 111 , snapshot(snapshot) |
121 { | 112 { |
122 } | 113 } |
123 | 114 |
124 DEFINE_INLINE_TRACE() | 115 DEFINE_INLINE_TRACE() |
125 { | 116 { |
126 visitor->trace(animation); | 117 visitor->trace(animation); |
127 visitor->trace(model); | 118 visitor->trace(model); |
128 visitor->trace(snapshot); | |
129 } | 119 } |
130 | 120 |
131 RawPtrWillBeMember<Animation> animation; | 121 RawPtrWillBeMember<Animation> animation; |
132 RawPtrWillBeMember<KeyframeEffectModelBase> model; | 122 RawPtrWillBeMember<KeyframeEffectModelBase> model; |
133 CompositableStyleSnapshot snapshot; | 123 CompositableStyleSnapshot snapshot; |
134 }; | 124 }; |
135 | 125 |
136 CSSAnimationUpdate() | 126 CSSAnimationUpdate() |
137 { | 127 { |
138 } | 128 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const WillBeHeapHashSet<RawPtrWillBeMember<const Animation>>& suppressedAnim
ations() const { return m_suppressedAnimations; } | 222 const WillBeHeapHashSet<RawPtrWillBeMember<const Animation>>& suppressedAnim
ations() const { return m_suppressedAnimations; } |
233 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } | 223 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } |
234 const WillBeHeapVector<UpdatedAnimation>& animationsWithUpdates() const { re
turn m_animationsWithUpdates; } | 224 const WillBeHeapVector<UpdatedAnimation>& animationsWithUpdates() const { re
turn m_animationsWithUpdates; } |
235 const WillBeHeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates()
const { return m_animationsWithStyleUpdates; } | 225 const WillBeHeapVector<UpdatedAnimationStyle>& animationsWithStyleUpdates()
const { return m_animationsWithStyleUpdates; } |
236 | 226 |
237 struct NewTransition { | 227 struct NewTransition { |
238 ALLOW_ONLY_INLINE_ALLOCATION(); | 228 ALLOW_ONLY_INLINE_ALLOCATION(); |
239 public: | 229 public: |
240 DEFINE_INLINE_TRACE() | 230 DEFINE_INLINE_TRACE() |
241 { | 231 { |
242 visitor->trace(from); | |
243 visitor->trace(to); | |
244 visitor->trace(effect); | 232 visitor->trace(effect); |
245 } | 233 } |
246 | 234 |
247 CSSPropertyID id; | 235 CSSPropertyID id; |
248 RawPtrWillBeMember<const AnimatableValue> from; | 236 RawPtr<const AnimatableValue> from; |
249 RawPtrWillBeMember<const AnimatableValue> to; | 237 RawPtr<const AnimatableValue> to; |
250 RefPtrWillBeMember<InertEffect> effect; | 238 RefPtrWillBeMember<InertEffect> effect; |
251 }; | 239 }; |
252 using NewTransitionMap = WillBeHeapHashMap<CSSPropertyID, NewTransition>; | 240 using NewTransitionMap = WillBeHeapHashMap<CSSPropertyID, NewTransition>; |
253 const NewTransitionMap& newTransitions() const { return m_newTransitions; } | 241 const NewTransitionMap& newTransitions() const { return m_newTransitions; } |
254 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } | 242 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } |
255 const HashSet<CSSPropertyID>& finishedTransitions() const { return m_finishe
dTransitions; } | 243 const HashSet<CSSPropertyID>& finishedTransitions() const { return m_finishe
dTransitions; } |
256 | 244 |
257 void adoptActiveInterpolationsForAnimations(ActiveInterpolationMap& newMap)
{ newMap.swap(m_activeInterpolationsForAnimations); } | 245 void adoptActiveInterpolationsForAnimations(ActiveInterpolationMap& newMap)
{ newMap.swap(m_activeInterpolationsForAnimations); } |
258 void adoptActiveInterpolationsForTransitions(ActiveInterpolationMap& newMap)
{ newMap.swap(m_activeInterpolationsForTransitions); } | 246 void adoptActiveInterpolationsForTransitions(ActiveInterpolationMap& newMap)
{ newMap.swap(m_activeInterpolationsForTransitions); } |
259 const ActiveInterpolationMap& activeInterpolationsForAnimations() const { re
turn m_activeInterpolationsForAnimations; } | 247 const ActiveInterpolationMap& activeInterpolationsForAnimations() const { re
turn m_activeInterpolationsForAnimations; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 Vector<AtomicString> m_animationsWithPauseToggled; | 287 Vector<AtomicString> m_animationsWithPauseToggled; |
300 WillBeHeapVector<UpdatedAnimation> m_animationsWithUpdates; | 288 WillBeHeapVector<UpdatedAnimation> m_animationsWithUpdates; |
301 WillBeHeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; | 289 WillBeHeapVector<UpdatedAnimationStyle> m_animationsWithStyleUpdates; |
302 | 290 |
303 NewTransitionMap m_newTransitions; | 291 NewTransitionMap m_newTransitions; |
304 HashSet<CSSPropertyID> m_cancelledTransitions; | 292 HashSet<CSSPropertyID> m_cancelledTransitions; |
305 HashSet<CSSPropertyID> m_finishedTransitions; | 293 HashSet<CSSPropertyID> m_finishedTransitions; |
306 | 294 |
307 ActiveInterpolationMap m_activeInterpolationsForAnimations; | 295 ActiveInterpolationMap m_activeInterpolationsForAnimations; |
308 ActiveInterpolationMap m_activeInterpolationsForTransitions; | 296 ActiveInterpolationMap m_activeInterpolationsForTransitions; |
| 297 |
| 298 friend class PendingAnimationUpdate; |
309 }; | 299 }; |
310 | 300 |
311 } // namespace blink | 301 } // namespace blink |
312 | 302 |
313 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 303 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
314 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 304 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
315 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty
le); | 305 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty
le); |
316 | 306 |
317 #endif | 307 #endif |
OLD | NEW |