| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 double animation_start_time, | 355 double animation_start_time, |
| 356 std::unique_ptr<cc::AnimationCurve> curve) override {} | 356 std::unique_ptr<cc::AnimationCurve> curve) override {} |
| 357 | 357 |
| 358 // Implementation of LayerThreadedAnimationDelegate. | 358 // Implementation of LayerThreadedAnimationDelegate. |
| 359 void AddThreadedAnimation(std::unique_ptr<cc::Animation> animation) override; | 359 void AddThreadedAnimation(std::unique_ptr<cc::Animation> animation) override; |
| 360 void RemoveThreadedAnimation(int animation_id) override; | 360 void RemoveThreadedAnimation(int animation_id) override; |
| 361 | 361 |
| 362 void AttachLayerToAnimationPlayer(int layer_id); | 362 void AttachLayerToAnimationPlayer(int layer_id); |
| 363 void DetachLayerFromAnimationPlayer(); | 363 void DetachLayerFromAnimationPlayer(); |
| 364 | 364 |
| 365 void set_animation_metrics_reporter(AnimationMetricsReporter* reporter) { |
| 366 animation_metrics_reporter_ = reporter; |
| 367 } |
| 368 |
| 365 // This is the queue of animations to run. | 369 // This is the queue of animations to run. |
| 366 AnimationQueue animation_queue_; | 370 AnimationQueue animation_queue_; |
| 367 | 371 |
| 368 // The target of all layer animations. | 372 // The target of all layer animations. |
| 369 LayerAnimationDelegate* delegate_; | 373 LayerAnimationDelegate* delegate_; |
| 370 | 374 |
| 371 // Plays CC animations. | 375 // Plays CC animations. |
| 372 scoped_refptr<cc::AnimationPlayer> animation_player_; | 376 scoped_refptr<cc::AnimationPlayer> animation_player_; |
| 373 | 377 |
| 374 // The currently running animations. | 378 // The currently running animations. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 394 bool is_started_; | 398 bool is_started_; |
| 395 | 399 |
| 396 // This prevents the animator from automatically stepping through animations | 400 // This prevents the animator from automatically stepping through animations |
| 397 // and allows for manual stepping. | 401 // and allows for manual stepping. |
| 398 bool disable_timer_for_test_; | 402 bool disable_timer_for_test_; |
| 399 | 403 |
| 400 // Prevents timer adjustments in case when we start multiple animations | 404 // Prevents timer adjustments in case when we start multiple animations |
| 401 // with preemption strategies that discard previous animations. | 405 // with preemption strategies that discard previous animations. |
| 402 bool adding_animations_; | 406 bool adding_animations_; |
| 403 | 407 |
| 408 // Helper to output UMA performance metrics. |
| 409 AnimationMetricsReporter* animation_metrics_reporter_; |
| 410 |
| 404 // Observers are notified when layer animations end, are scheduled or are | 411 // Observers are notified when layer animations end, are scheduled or are |
| 405 // aborted. | 412 // aborted. |
| 406 base::ObserverList<LayerAnimationObserver> observers_; | 413 base::ObserverList<LayerAnimationObserver> observers_; |
| 407 | 414 |
| 408 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); | 415 DISALLOW_COPY_AND_ASSIGN(LayerAnimator); |
| 409 }; | 416 }; |
| 410 | 417 |
| 411 } // namespace ui | 418 } // namespace ui |
| 412 | 419 |
| 413 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ | 420 #endif // UI_COMPOSITOR_LAYER_ANIMATOR_H_ |
| OLD | NEW |