OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 } | 2733 } |
2734 } | 2734 } |
2735 | 2735 |
2736 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { | 2736 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { |
2737 if (!settings_.accelerated_animation_enabled || | 2737 if (!settings_.accelerated_animation_enabled || |
2738 !needs_animate_layers() || | 2738 !needs_animate_layers() || |
2739 !active_tree_->root_layer()) | 2739 !active_tree_->root_layer()) |
2740 return; | 2740 return; |
2741 | 2741 |
2742 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); | 2742 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); |
2743 | |
2744 // TODO(ajuma): http://crbug.com/178171 - Animations use double for monotonic | |
2745 // time. | |
2746 double monotonic_time_for_cc_animations = | |
2747 (monotonic_time - base::TimeTicks()).InSecondsF(); | |
2748 AnimationRegistrar::AnimationControllerMap copy = | 2743 AnimationRegistrar::AnimationControllerMap copy = |
2749 animation_registrar_->active_animation_controllers(); | 2744 animation_registrar_->active_animation_controllers(); |
2750 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); | 2745 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); |
2751 iter != copy.end(); | 2746 iter != copy.end(); |
2752 ++iter) | 2747 ++iter) |
2753 (*iter).second->Animate(monotonic_time_for_cc_animations); | 2748 (*iter).second->Animate(monotonic_time); |
2754 | 2749 |
2755 SetNeedsRedraw(); | 2750 SetNeedsRedraw(); |
2756 } | 2751 } |
2757 | 2752 |
2758 void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { | 2753 void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { |
2759 if (!settings_.accelerated_animation_enabled || | 2754 if (!settings_.accelerated_animation_enabled || |
2760 !needs_animate_layers() || | 2755 !needs_animate_layers() || |
2761 !active_tree_->root_layer()) | 2756 !active_tree_->root_layer()) |
2762 return; | 2757 return; |
2763 | 2758 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3072 swap_promise_monitor_.erase(monitor); | 3067 swap_promise_monitor_.erase(monitor); |
3073 } | 3068 } |
3074 | 3069 |
3075 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3070 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3076 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3071 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3077 for (; it != swap_promise_monitor_.end(); it++) | 3072 for (; it != swap_promise_monitor_.end(); it++) |
3078 (*it)->OnSetNeedsRedrawOnImpl(); | 3073 (*it)->OnSetNeedsRedrawOnImpl(); |
3079 } | 3074 } |
3080 | 3075 |
3081 } // namespace cc | 3076 } // namespace cc |
OLD | NEW |