Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/layers/layer.cc ('K') | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« cc/layers/layer.cc ('K') | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698