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

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

Issue 2895283004: Replace AnimatableValues with ComputedStyle references for CSS Transitions (Closed)
Patch Set: Created 3 years, 7 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 animations_with_updates_.push_back(UpdatedCSSAnimation( 160 animations_with_updates_.push_back(UpdatedCSSAnimation(
161 index, animation, effect, specified_timing, style_rule)); 161 index, animation, effect, specified_timing, style_rule));
162 suppressed_animations_.insert(animation); 162 suppressed_animations_.insert(animation);
163 } 163 }
164 void UpdateCompositorKeyframes(Animation* animation) { 164 void UpdateCompositorKeyframes(Animation* animation) {
165 updated_compositor_keyframes_.push_back(animation); 165 updated_compositor_keyframes_.push_back(animation);
166 } 166 }
167 167
168 void StartTransition( 168 void StartTransition(
169 const PropertyHandle& property, 169 const PropertyHandle& property,
170 RefPtr<AnimatableValue> from, 170 RefPtr<const ComputedStyle> from,
171 RefPtr<AnimatableValue> to, 171 RefPtr<const ComputedStyle> to,
172 PassRefPtr<AnimatableValue> reversing_adjusted_start_value, 172 PassRefPtr<const ComputedStyle> reversing_adjusted_start_value,
173 double reversing_shortening_factor, 173 double reversing_shortening_factor,
174 const InertEffect& effect) { 174 const InertEffect& effect) {
175 NewTransition new_transition; 175 NewTransition new_transition;
176 new_transition.property = property; 176 new_transition.property = property;
177 new_transition.from = std::move(from); 177 new_transition.from = std::move(from);
178 new_transition.to = std::move(to); 178 new_transition.to = std::move(to);
179 new_transition.reversing_adjusted_start_value = 179 new_transition.reversing_adjusted_start_value =
180 std::move(reversing_adjusted_start_value); 180 std::move(reversing_adjusted_start_value);
181 new_transition.reversing_shortening_factor = reversing_shortening_factor; 181 new_transition.reversing_shortening_factor = reversing_shortening_factor;
182 new_transition.effect = &effect; 182 new_transition.effect = &effect;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return updated_compositor_keyframes_; 214 return updated_compositor_keyframes_;
215 } 215 }
216 216
217 struct NewTransition { 217 struct NewTransition {
218 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 218 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
219 219
220 public: 220 public:
221 DEFINE_INLINE_TRACE() { visitor->Trace(effect); } 221 DEFINE_INLINE_TRACE() { visitor->Trace(effect); }
222 222
223 PropertyHandle property = HashTraits<blink::PropertyHandle>::EmptyValue(); 223 PropertyHandle property = HashTraits<blink::PropertyHandle>::EmptyValue();
224 RefPtr<AnimatableValue> from; 224 RefPtr<const ComputedStyle> from;
225 RefPtr<AnimatableValue> to; 225 RefPtr<const ComputedStyle> to;
226 RefPtr<AnimatableValue> reversing_adjusted_start_value; 226 RefPtr<const ComputedStyle> reversing_adjusted_start_value;
227 double reversing_shortening_factor; 227 double reversing_shortening_factor;
228 Member<const InertEffect> effect; 228 Member<const InertEffect> effect;
229 }; 229 };
230 using NewTransitionMap = HeapHashMap<PropertyHandle, NewTransition>; 230 using NewTransitionMap = HeapHashMap<PropertyHandle, NewTransition>;
231 const NewTransitionMap& NewTransitions() const { return new_transitions_; } 231 const NewTransitionMap& NewTransitions() const { return new_transitions_; }
232 const HashSet<PropertyHandle>& CancelledTransitions() const { 232 const HashSet<PropertyHandle>& CancelledTransitions() const {
233 return cancelled_transitions_; 233 return cancelled_transitions_;
234 } 234 }
235 const HashSet<PropertyHandle>& FinishedTransitions() const { 235 const HashSet<PropertyHandle>& FinishedTransitions() const {
236 return finished_transitions_; 236 return finished_transitions_;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 ActiveInterpolationsMap active_interpolations_for_animations_; 304 ActiveInterpolationsMap active_interpolations_for_animations_;
305 ActiveInterpolationsMap active_interpolations_for_custom_transitions_; 305 ActiveInterpolationsMap active_interpolations_for_custom_transitions_;
306 ActiveInterpolationsMap active_interpolations_for_standard_transitions_; 306 ActiveInterpolationsMap active_interpolations_for_standard_transitions_;
307 307
308 friend class PendingAnimationUpdate; 308 friend class PendingAnimationUpdate;
309 }; 309 };
310 310
311 } // namespace blink 311 } // namespace blink
312 312
313 #endif 313 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698