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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Sets the layer animation delegate the animator is associated with. The | 110 // Sets the layer animation delegate the animator is associated with. The |
111 // animator does not own the delegate. The layer animator expects a non-NULL | 111 // animator does not own the delegate. The layer animator expects a non-NULL |
112 // delegate for most of its operations, so do not call any methods without | 112 // delegate for most of its operations, so do not call any methods without |
113 // a valid delegate installed. | 113 // a valid delegate installed. |
114 void SetDelegate(LayerAnimationDelegate* delegate); | 114 void SetDelegate(LayerAnimationDelegate* delegate); |
115 | 115 |
116 // Unsubscribe from |cc_layer_| and subscribe to |new_layer|. | 116 // Unsubscribe from |cc_layer_| and subscribe to |new_layer|. |
117 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); | 117 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
118 | 118 |
119 // Attach AnimationPlayer to Layer and AnimationTimeline | 119 // Attach AnimationPlayer to Layer and AnimationTimeline |
120 void SetCompositor(Compositor* compositor); | 120 void AttachLayerAndTimeline(Compositor* compositor); |
121 // Detach AnimationPlayer from Layer and AnimationTimeline | 121 // Detach AnimationPlayer from Layer and AnimationTimeline |
122 void ResetCompositor(Compositor* compositor); | 122 void DetachLayerAndTimeline(Compositor* compositor); |
123 | 123 |
124 cc::AnimationPlayer* GetAnimationPlayerForTesting() const; | 124 cc::AnimationPlayer* GetAnimationPlayerForTesting() const; |
125 | 125 |
126 // Sets the animation preemption strategy. This determines the behaviour if | 126 // Sets the animation preemption strategy. This determines the behaviour if |
127 // a property is set during an animation. The default is | 127 // a property is set during an animation. The default is |
128 // IMMEDIATELY_SET_NEW_TARGET (see ImmediatelySetNewTarget below). | 128 // IMMEDIATELY_SET_NEW_TARGET (see ImmediatelySetNewTarget below). |
129 void set_preemption_strategy(PreemptionStrategy strategy) { | 129 void set_preemption_strategy(PreemptionStrategy strategy) { |
130 preemption_strategy_ = strategy; | 130 preemption_strategy_ = strategy; |
131 } | 131 } |
132 | 132 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 bool disable_timer_for_test_; | 399 bool disable_timer_for_test_; |
400 | 400 |
401 // Prevents timer adjustments in case when we start multiple animations | 401 // Prevents timer adjustments in case when we start multiple animations |
402 // with preemption strategies that discard previous animations. | 402 // with preemption strategies that discard previous animations. |
403 bool adding_animations_; | 403 bool adding_animations_; |
404 | 404 |
405 // Observers are notified when layer animations end, are scheduled or are | 405 // Observers are notified when layer animations end, are scheduled or are |
406 // aborted. | 406 // aborted. |
407 base::ObserverList<LayerAnimationObserver> observers_; | 407 base::ObserverList<LayerAnimationObserver> observers_; |
408 | 408 |
409 // We store a state of ElementAnimations here to save it in | |
410 // ResetCompositor/SetCompositor scope. | |
411 // TODO(loyso): Remove it. crbug.com/592873. | |
412 scoped_refptr<cc::ElementAnimations> element_animations_state_; | |
413 | |
414 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 409 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
415 }; | 410 }; |
416 | 411 |
417 } // namespace ui | 412 } // namespace ui |
418 | 413 |
419 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 414 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
OLD | NEW |