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