| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/animation/layer_animation_controller.h" | 5 #include "cc/animation/layer_animation_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
| 10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // According to render layer backing, these are for testing only. | 91 // According to render layer backing, these are for testing only. |
| 92 void LayerAnimationController::SuspendAnimations(double monotonic_time) { | 92 void LayerAnimationController::SuspendAnimations(double monotonic_time) { |
| 93 for (size_t i = 0; i < active_animations_.size(); ++i) { | 93 for (size_t i = 0; i < active_animations_.size(); ++i) { |
| 94 if (!active_animations_[i]->is_finished()) | 94 if (!active_animations_[i]->is_finished()) |
| 95 active_animations_[i]->SetRunState(Animation::Paused, monotonic_time); | 95 active_animations_[i]->SetRunState(Animation::Paused, monotonic_time); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Looking at GraphicsLayerCA, this appears to be the analog to | 99 // Looking at GraphicsLayerCA, this appears to be the analog to |
| 100 // suspendAnimations, which is for testing. | 100 // SuspendAnimations, which is for testing. |
| 101 void LayerAnimationController::ResumeAnimations(double monotonic_time) { | 101 void LayerAnimationController::ResumeAnimations(double monotonic_time) { |
| 102 for (size_t i = 0; i < active_animations_.size(); ++i) { | 102 for (size_t i = 0; i < active_animations_.size(); ++i) { |
| 103 if (active_animations_[i]->run_state() == Animation::Paused) | 103 if (active_animations_[i]->run_state() == Animation::Paused) |
| 104 active_animations_[i]->SetRunState(Animation::Running, monotonic_time); | 104 active_animations_[i]->SetRunState(Animation::Running, monotonic_time); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Ensures that the list of active animations on the main thread and the impl | 108 // Ensures that the list of active animations on the main thread and the impl |
| 109 // thread are kept in sync. | 109 // thread are kept in sync. |
| 110 void LayerAnimationController::PushAnimationUpdatesTo( | 110 void LayerAnimationController::PushAnimationUpdatesTo( |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 ObserverListBase<LayerAnimationValueObserver>::Iterator it(observers_); | 619 ObserverListBase<LayerAnimationValueObserver>::Iterator it(observers_); |
| 620 LayerAnimationValueObserver* obs; | 620 LayerAnimationValueObserver* obs; |
| 621 while ((obs = it.GetNext()) != NULL) | 621 while ((obs = it.GetNext()) != NULL) |
| 622 if (obs->IsActive()) | 622 if (obs->IsActive()) |
| 623 return true; | 623 return true; |
| 624 } | 624 } |
| 625 return false; | 625 return false; |
| 626 } | 626 } |
| 627 | 627 |
| 628 } // namespace cc | 628 } // namespace cc |
| OLD | NEW |