Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 float GetTargetGrayscale() const; | 98 float GetTargetGrayscale() const; |
| 99 | 99 |
| 100 // Sets the color on the delegate. May cause an implicit animation. | 100 // Sets the color on the delegate. May cause an implicit animation. |
| 101 virtual void SetColor(SkColor color); | 101 virtual void SetColor(SkColor color); |
| 102 SkColor GetTargetColor() const; | 102 SkColor GetTargetColor() const; |
| 103 | 103 |
| 104 // Returns the default length of animations, including adjustment for slow | 104 // Returns the default length of animations, including adjustment for slow |
| 105 // animation mode if set. | 105 // animation mode if set. |
| 106 base::TimeDelta GetTransitionDuration() const; | 106 base::TimeDelta GetTransitionDuration() const; |
| 107 | 107 |
| 108 // Sets |transition_duration_| unless |is_transition_duration_locked_| is set. | |
| 109 void SetTransitionDuration(base::TimeDelta duration); | |
|
tapted
2016/02/16 06:47:58
Ah curious. So I think the way this is intended to
spqchan
2016/02/16 23:18:18
Ah, that makes more sense. I made the change for i
| |
| 110 | |
| 108 // Sets the layer animation delegate the animator is associated with. The | 111 // Sets the layer animation delegate the animator is associated with. The |
| 109 // animator does not own the delegate. The layer animator expects a non-NULL | 112 // animator does not own the delegate. The layer animator expects a non-NULL |
| 110 // delegate for most of its operations, so do not call any methods without | 113 // delegate for most of its operations, so do not call any methods without |
| 111 // a valid delegate installed. | 114 // a valid delegate installed. |
| 112 void SetDelegate(LayerAnimationDelegate* delegate); | 115 void SetDelegate(LayerAnimationDelegate* delegate); |
| 113 | 116 |
| 114 // Unsubscribe from |cc_layer_| and subscribe to |new_layer|. | 117 // Unsubscribe from |cc_layer_| and subscribe to |new_layer|. |
| 115 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); | 118 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
| 116 | 119 |
| 117 // Attach AnimationPlayer to Layer and AnimationTimeline | 120 // Attach AnimationPlayer to Layer and AnimationTimeline |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 bool StartSequenceImmediately(LayerAnimationSequence* sequence); | 321 bool StartSequenceImmediately(LayerAnimationSequence* sequence); |
| 319 | 322 |
| 320 // Sets the value of target as if all the running and queued animations were | 323 // Sets the value of target as if all the running and queued animations were |
| 321 // allowed to finish. | 324 // allowed to finish. |
| 322 void GetTargetValue(LayerAnimationElement::TargetValue* target) const; | 325 void GetTargetValue(LayerAnimationElement::TargetValue* target) const; |
| 323 | 326 |
| 324 // Called whenever an animation is added to the animation queue. Either by | 327 // Called whenever an animation is added to the animation queue. Either by |
| 325 // starting the animation or adding to the queue. | 328 // starting the animation or adding to the queue. |
| 326 void OnScheduled(LayerAnimationSequence* sequence); | 329 void OnScheduled(LayerAnimationSequence* sequence); |
| 327 | 330 |
| 328 // Sets |transition_duration_| unless |is_transition_duration_locked_| is set. | |
| 329 void SetTransitionDuration(base::TimeDelta duration); | |
| 330 | |
| 331 // Clears the animation queues and notifies any running animations that they | 331 // Clears the animation queues and notifies any running animations that they |
| 332 // have been aborted. | 332 // have been aborted. |
| 333 void ClearAnimationsInternal(); | 333 void ClearAnimationsInternal(); |
| 334 | 334 |
| 335 // Cleans up any running animations that may have been deleted. | 335 // Cleans up any running animations that may have been deleted. |
| 336 void PurgeDeletedAnimations(); | 336 void PurgeDeletedAnimations(); |
| 337 | 337 |
| 338 LayerAnimatorCollection* GetLayerAnimatorCollection(); | 338 LayerAnimatorCollection* GetLayerAnimatorCollection(); |
| 339 | 339 |
| 340 // LayerAnimationEventObserver | 340 // LayerAnimationEventObserver |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 // Observers are notified when layer animations end, are scheduled or are | 389 // Observers are notified when layer animations end, are scheduled or are |
| 390 // aborted. | 390 // aborted. |
| 391 base::ObserverList<LayerAnimationObserver> observers_; | 391 base::ObserverList<LayerAnimationObserver> observers_; |
| 392 | 392 |
| 393 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 393 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
| 394 }; | 394 }; |
| 395 | 395 |
| 396 } // namespace ui | 396 } // namespace ui |
| 397 | 397 |
| 398 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 398 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| OLD | NEW |