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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 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
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 m_newAnimations.push_back( 137 m_newAnimations.push_back(
138 NewCSSAnimation(animationName, nameIndex, effect, timing, styleRule)); 138 NewCSSAnimation(animationName, nameIndex, effect, timing, styleRule));
139 } 139 }
140 // Returns whether animation has been suppressed and should be filtered during 140 // Returns whether animation has been suppressed and should be filtered during
141 // style application. 141 // style application.
142 bool isSuppressedAnimation(const Animation* animation) const { 142 bool isSuppressedAnimation(const Animation* animation) const {
143 return m_suppressedAnimations.contains(animation); 143 return m_suppressedAnimations.contains(animation);
144 } 144 }
145 void cancelAnimation(size_t index, const Animation& animation) { 145 void cancelAnimation(size_t index, const Animation& animation) {
146 m_cancelledAnimationIndices.push_back(index); 146 m_cancelledAnimationIndices.push_back(index);
147 m_suppressedAnimations.add(&animation); 147 m_suppressedAnimations.insert(&animation);
148 } 148 }
149 void toggleAnimationIndexPaused(size_t index) { 149 void toggleAnimationIndexPaused(size_t index) {
150 m_animationIndicesWithPauseToggled.push_back(index); 150 m_animationIndicesWithPauseToggled.push_back(index);
151 } 151 }
152 void updateAnimation(size_t index, 152 void updateAnimation(size_t index,
153 Animation* animation, 153 Animation* animation,
154 const InertEffect& effect, 154 const InertEffect& effect,
155 const Timing& specifiedTiming, 155 const Timing& specifiedTiming,
156 StyleRuleKeyframes* styleRule) { 156 StyleRuleKeyframes* styleRule) {
157 m_animationsWithUpdates.push_back(UpdatedCSSAnimation( 157 m_animationsWithUpdates.push_back(UpdatedCSSAnimation(
158 index, animation, effect, specifiedTiming, styleRule)); 158 index, animation, effect, specifiedTiming, styleRule));
159 m_suppressedAnimations.add(animation); 159 m_suppressedAnimations.insert(animation);
160 } 160 }
161 void updateCompositorKeyframes(Animation* animation) { 161 void updateCompositorKeyframes(Animation* animation) {
162 m_updatedCompositorKeyframes.push_back(animation); 162 m_updatedCompositorKeyframes.push_back(animation);
163 } 163 }
164 164
165 void startTransition(CSSPropertyID id, 165 void startTransition(CSSPropertyID id,
166 const AnimatableValue* from, 166 const AnimatableValue* from,
167 const AnimatableValue* to, 167 const AnimatableValue* to,
168 PassRefPtr<AnimatableValue> reversingAdjustedStartValue, 168 PassRefPtr<AnimatableValue> reversingAdjustedStartValue,
169 double reversingShorteningFactor, 169 double reversingShorteningFactor,
170 const InertEffect& effect) { 170 const InertEffect& effect) {
171 NewTransition newTransition; 171 NewTransition newTransition;
172 newTransition.id = id; 172 newTransition.id = id;
173 newTransition.from = from; 173 newTransition.from = from;
174 newTransition.to = to; 174 newTransition.to = to;
175 newTransition.reversingAdjustedStartValue = reversingAdjustedStartValue; 175 newTransition.reversingAdjustedStartValue = reversingAdjustedStartValue;
176 newTransition.reversingShorteningFactor = reversingShorteningFactor; 176 newTransition.reversingShorteningFactor = reversingShorteningFactor;
177 newTransition.effect = &effect; 177 newTransition.effect = &effect;
178 m_newTransitions.set(id, newTransition); 178 m_newTransitions.set(id, newTransition);
179 } 179 }
180 bool isCancelledTransition(CSSPropertyID id) const { 180 bool isCancelledTransition(CSSPropertyID id) const {
181 return m_cancelledTransitions.contains(id); 181 return m_cancelledTransitions.contains(id);
182 } 182 }
183 void cancelTransition(CSSPropertyID id) { m_cancelledTransitions.add(id); } 183 void cancelTransition(CSSPropertyID id) { m_cancelledTransitions.insert(id); }
184 void finishTransition(CSSPropertyID id) { m_finishedTransitions.add(id); } 184 void finishTransition(CSSPropertyID id) { m_finishedTransitions.insert(id); }
185 185
186 const HeapVector<NewCSSAnimation>& newAnimations() const { 186 const HeapVector<NewCSSAnimation>& newAnimations() const {
187 return m_newAnimations; 187 return m_newAnimations;
188 } 188 }
189 const Vector<size_t>& cancelledAnimationIndices() const { 189 const Vector<size_t>& cancelledAnimationIndices() const {
190 return m_cancelledAnimationIndices; 190 return m_cancelledAnimationIndices;
191 } 191 }
192 const HeapHashSet<Member<const Animation>>& suppressedAnimations() const { 192 const HeapHashSet<Member<const Animation>>& suppressedAnimations() const {
193 return m_suppressedAnimations; 193 return m_suppressedAnimations;
194 } 194 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 ActiveInterpolationsMap m_activeInterpolationsForAnimations; 280 ActiveInterpolationsMap m_activeInterpolationsForAnimations;
281 ActiveInterpolationsMap m_activeInterpolationsForTransitions; 281 ActiveInterpolationsMap m_activeInterpolationsForTransitions;
282 282
283 friend class PendingAnimationUpdate; 283 friend class PendingAnimationUpdate;
284 }; 284 };
285 285
286 } // namespace blink 286 } // namespace blink
287 287
288 #endif 288 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698