Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h

Issue 2724313002: Split transitions update storage between custom and standard properties (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/EffectStack.h" 8 #include "core/animation/EffectStack.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 ~CSSAnimationUpdate() {} 100 ~CSSAnimationUpdate() {}
101 101
102 void copy(const CSSAnimationUpdate& update) { 102 void copy(const CSSAnimationUpdate& update) {
103 DCHECK(isEmpty()); 103 DCHECK(isEmpty());
104 m_newAnimations = update.newAnimations(); 104 m_newAnimations = update.newAnimations();
105 m_animationsWithUpdates = update.animationsWithUpdates(); 105 m_animationsWithUpdates = update.animationsWithUpdates();
106 m_newTransitions = update.newTransitions(); 106 m_newTransitions = update.newTransitions();
107 m_activeInterpolationsForAnimations = 107 m_activeInterpolationsForAnimations =
108 update.activeInterpolationsForAnimations(); 108 update.activeInterpolationsForAnimations();
109 m_activeInterpolationsForTransitions = 109 m_activeInterpolationsForCustomTransitions =
110 update.activeInterpolationsForTransitions(); 110 update.activeInterpolationsForCustomTransitions();
111 m_activeInterpolationsForStandardTransitions =
112 update.activeInterpolationsForStandardTransitions();
111 m_cancelledAnimationIndices = update.cancelledAnimationIndices(); 113 m_cancelledAnimationIndices = update.cancelledAnimationIndices();
112 m_animationIndicesWithPauseToggled = 114 m_animationIndicesWithPauseToggled =
113 update.animationIndicesWithPauseToggled(); 115 update.animationIndicesWithPauseToggled();
114 m_cancelledTransitions = update.cancelledTransitions(); 116 m_cancelledTransitions = update.cancelledTransitions();
115 m_finishedTransitions = update.finishedTransitions(); 117 m_finishedTransitions = update.finishedTransitions();
116 m_updatedCompositorKeyframes = update.updatedCompositorKeyframes(); 118 m_updatedCompositorKeyframes = update.updatedCompositorKeyframes();
117 } 119 }
118 120
119 void clear() { 121 void clear() {
120 m_newAnimations.clear(); 122 m_newAnimations.clear();
121 m_animationsWithUpdates.clear(); 123 m_animationsWithUpdates.clear();
122 m_newTransitions.clear(); 124 m_newTransitions.clear();
123 m_activeInterpolationsForAnimations.clear(); 125 m_activeInterpolationsForAnimations.clear();
124 m_activeInterpolationsForTransitions.clear(); 126 m_activeInterpolationsForCustomTransitions.clear();
127 m_activeInterpolationsForStandardTransitions.clear();
125 m_cancelledAnimationIndices.clear(); 128 m_cancelledAnimationIndices.clear();
126 m_animationIndicesWithPauseToggled.clear(); 129 m_animationIndicesWithPauseToggled.clear();
127 m_cancelledTransitions.clear(); 130 m_cancelledTransitions.clear();
128 m_finishedTransitions.clear(); 131 m_finishedTransitions.clear();
129 m_updatedCompositorKeyframes.clear(); 132 m_updatedCompositorKeyframes.clear();
130 } 133 }
131 134
132 void startAnimation(const AtomicString& animationName, 135 void startAnimation(const AtomicString& animationName,
133 size_t nameIndex, 136 size_t nameIndex,
134 const InertEffect& effect, 137 const InertEffect& effect,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const HashSet<PropertyHandle>& cancelledTransitions() const { 227 const HashSet<PropertyHandle>& cancelledTransitions() const {
225 return m_cancelledTransitions; 228 return m_cancelledTransitions;
226 } 229 }
227 const HashSet<PropertyHandle>& finishedTransitions() const { 230 const HashSet<PropertyHandle>& finishedTransitions() const {
228 return m_finishedTransitions; 231 return m_finishedTransitions;
229 } 232 }
230 233
231 void adoptActiveInterpolationsForAnimations(ActiveInterpolationsMap& newMap) { 234 void adoptActiveInterpolationsForAnimations(ActiveInterpolationsMap& newMap) {
232 newMap.swap(m_activeInterpolationsForAnimations); 235 newMap.swap(m_activeInterpolationsForAnimations);
233 } 236 }
234 void adoptActiveInterpolationsForTransitions( 237 void adoptActiveInterpolationsForCustomTransitions(
235 ActiveInterpolationsMap& newMap) { 238 ActiveInterpolationsMap& newMap) {
236 newMap.swap(m_activeInterpolationsForTransitions); 239 newMap.swap(m_activeInterpolationsForCustomTransitions);
240 }
241 void adoptActiveInterpolationsForStandardTransitions(
242 ActiveInterpolationsMap& newMap) {
243 newMap.swap(m_activeInterpolationsForStandardTransitions);
237 } 244 }
238 const ActiveInterpolationsMap& activeInterpolationsForAnimations() const { 245 const ActiveInterpolationsMap& activeInterpolationsForAnimations() const {
239 return m_activeInterpolationsForAnimations; 246 return m_activeInterpolationsForAnimations;
240 } 247 }
241 const ActiveInterpolationsMap& activeInterpolationsForTransitions() const { 248 const ActiveInterpolationsMap& activeInterpolationsForCustomTransitions()
242 return m_activeInterpolationsForTransitions; 249 const {
250 return m_activeInterpolationsForCustomTransitions;
251 }
252 const ActiveInterpolationsMap& activeInterpolationsForStandardTransitions()
253 const {
254 return m_activeInterpolationsForStandardTransitions;
243 } 255 }
244 ActiveInterpolationsMap& activeInterpolationsForAnimations() { 256 ActiveInterpolationsMap& activeInterpolationsForAnimations() {
245 return m_activeInterpolationsForAnimations; 257 return m_activeInterpolationsForAnimations;
246 } 258 }
247 259
248 bool isEmpty() const { 260 bool isEmpty() const {
249 return m_newAnimations.isEmpty() && m_cancelledAnimationIndices.isEmpty() && 261 return m_newAnimations.isEmpty() && m_cancelledAnimationIndices.isEmpty() &&
250 m_suppressedAnimations.isEmpty() && 262 m_suppressedAnimations.isEmpty() &&
251 m_animationIndicesWithPauseToggled.isEmpty() && 263 m_animationIndicesWithPauseToggled.isEmpty() &&
252 m_animationsWithUpdates.isEmpty() && m_newTransitions.isEmpty() && 264 m_animationsWithUpdates.isEmpty() && m_newTransitions.isEmpty() &&
253 m_cancelledTransitions.isEmpty() && 265 m_cancelledTransitions.isEmpty() &&
254 m_finishedTransitions.isEmpty() && 266 m_finishedTransitions.isEmpty() &&
255 m_activeInterpolationsForAnimations.isEmpty() && 267 m_activeInterpolationsForAnimations.isEmpty() &&
256 m_activeInterpolationsForTransitions.isEmpty() && 268 m_activeInterpolationsForCustomTransitions.isEmpty() &&
269 m_activeInterpolationsForStandardTransitions.isEmpty() &&
257 m_updatedCompositorKeyframes.isEmpty(); 270 m_updatedCompositorKeyframes.isEmpty();
258 } 271 }
259 272
260 DEFINE_INLINE_TRACE() { 273 DEFINE_INLINE_TRACE() {
261 visitor->trace(m_newTransitions); 274 visitor->trace(m_newTransitions);
262 visitor->trace(m_newAnimations); 275 visitor->trace(m_newAnimations);
263 visitor->trace(m_suppressedAnimations); 276 visitor->trace(m_suppressedAnimations);
264 visitor->trace(m_animationsWithUpdates); 277 visitor->trace(m_animationsWithUpdates);
265 visitor->trace(m_updatedCompositorKeyframes); 278 visitor->trace(m_updatedCompositorKeyframes);
266 } 279 }
267 280
268 private: 281 private:
269 // Order is significant since it defines the order in which new animations 282 // Order is significant since it defines the order in which new animations
270 // will be started. Note that there may be multiple animations present 283 // will be started. Note that there may be multiple animations present
271 // with the same name, due to the way in which we split up animations with 284 // with the same name, due to the way in which we split up animations with
272 // incomplete keyframes. 285 // incomplete keyframes.
273 HeapVector<NewCSSAnimation> m_newAnimations; 286 HeapVector<NewCSSAnimation> m_newAnimations;
274 Vector<size_t> m_cancelledAnimationIndices; 287 Vector<size_t> m_cancelledAnimationIndices;
275 HeapHashSet<Member<const Animation>> m_suppressedAnimations; 288 HeapHashSet<Member<const Animation>> m_suppressedAnimations;
276 Vector<size_t> m_animationIndicesWithPauseToggled; 289 Vector<size_t> m_animationIndicesWithPauseToggled;
277 HeapVector<UpdatedCSSAnimation> m_animationsWithUpdates; 290 HeapVector<UpdatedCSSAnimation> m_animationsWithUpdates;
278 HeapVector<Member<Animation>> m_updatedCompositorKeyframes; 291 HeapVector<Member<Animation>> m_updatedCompositorKeyframes;
279 292
280 NewTransitionMap m_newTransitions; 293 NewTransitionMap m_newTransitions;
281 HashSet<PropertyHandle> m_cancelledTransitions; 294 HashSet<PropertyHandle> m_cancelledTransitions;
282 HashSet<PropertyHandle> m_finishedTransitions; 295 HashSet<PropertyHandle> m_finishedTransitions;
283 296
284 ActiveInterpolationsMap m_activeInterpolationsForAnimations; 297 ActiveInterpolationsMap m_activeInterpolationsForAnimations;
285 ActiveInterpolationsMap m_activeInterpolationsForTransitions; 298 ActiveInterpolationsMap m_activeInterpolationsForCustomTransitions;
299 ActiveInterpolationsMap m_activeInterpolationsForStandardTransitions;
286 300
287 friend class PendingAnimationUpdate; 301 friend class PendingAnimationUpdate;
288 }; 302 };
289 303
290 } // namespace blink 304 } // namespace blink
291 305
292 #endif 306 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698