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

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

Issue 194543002: Removing base::Time from SetAnimationEvents and PostAnimationEventsToMainThreadOnImplThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unused last_animation_time_ as well. Created 6 years, 9 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | 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 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after
2690 2690
2691 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, 2691 void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time,
2692 base::Time wall_clock_time) { 2692 base::Time wall_clock_time) {
2693 if (!settings_.accelerated_animation_enabled || 2693 if (!settings_.accelerated_animation_enabled ||
2694 animation_registrar_->active_animation_controllers().empty() || 2694 animation_registrar_->active_animation_controllers().empty() ||
2695 !active_tree_->root_layer()) 2695 !active_tree_->root_layer())
2696 return; 2696 return;
2697 2697
2698 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); 2698 TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers");
2699 2699
2700 last_animation_time_ = wall_clock_time;
2701 double monotonic_seconds = (monotonic_time - base::TimeTicks()).InSecondsF(); 2700 double monotonic_seconds = (monotonic_time - base::TimeTicks()).InSecondsF();
2702 2701
2703 AnimationRegistrar::AnimationControllerMap copy = 2702 AnimationRegistrar::AnimationControllerMap copy =
2704 animation_registrar_->active_animation_controllers(); 2703 animation_registrar_->active_animation_controllers();
2705 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); 2704 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
2706 iter != copy.end(); 2705 iter != copy.end();
2707 ++iter) 2706 ++iter)
2708 (*iter).second->Animate(monotonic_seconds); 2707 (*iter).second->Animate(monotonic_seconds);
2709 2708
2710 SetNeedsRedraw(); 2709 SetNeedsRedraw();
2711 } 2710 }
2712 2711
2713 void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { 2712 void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) {
2714 if (!settings_.accelerated_animation_enabled || 2713 if (!settings_.accelerated_animation_enabled ||
2715 animation_registrar_->active_animation_controllers().empty() || 2714 animation_registrar_->active_animation_controllers().empty() ||
2716 !active_tree_->root_layer()) 2715 !active_tree_->root_layer())
2717 return; 2716 return;
2718 2717
2719 TRACE_EVENT0("cc", "LayerTreeHostImpl::UpdateAnimationState"); 2718 TRACE_EVENT0("cc", "LayerTreeHostImpl::UpdateAnimationState");
2720 scoped_ptr<AnimationEventsVector> events = 2719 scoped_ptr<AnimationEventsVector> events =
2721 make_scoped_ptr(new AnimationEventsVector); 2720 make_scoped_ptr(new AnimationEventsVector);
2722 AnimationRegistrar::AnimationControllerMap copy = 2721 AnimationRegistrar::AnimationControllerMap copy =
2723 animation_registrar_->active_animation_controllers(); 2722 animation_registrar_->active_animation_controllers();
2724 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); 2723 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
2725 iter != copy.end(); 2724 iter != copy.end();
2726 ++iter) 2725 ++iter)
2727 (*iter).second->UpdateState(start_ready_animations, events.get()); 2726 (*iter).second->UpdateState(start_ready_animations, events.get());
2728 2727
2729 if (!events->empty()) { 2728 if (!events->empty()) {
2730 client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass(), 2729 client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass());
2731 last_animation_time_);
2732 } 2730 }
2733 } 2731 }
2734 2732
2735 base::TimeDelta LayerTreeHostImpl::LowFrequencyAnimationInterval() const { 2733 base::TimeDelta LayerTreeHostImpl::LowFrequencyAnimationInterval() const {
2736 return base::TimeDelta::FromSeconds(1); 2734 return base::TimeDelta::FromSeconds(1);
2737 } 2735 }
2738 2736
2739 void LayerTreeHostImpl::SendReleaseResourcesRecursive(LayerImpl* current) { 2737 void LayerTreeHostImpl::SendReleaseResourcesRecursive(LayerImpl* current) {
2740 DCHECK(current); 2738 DCHECK(current);
2741 current->ReleaseResources(); 2739 current->ReleaseResources();
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 swap_promise_monitor_.erase(monitor); 3036 swap_promise_monitor_.erase(monitor);
3039 } 3037 }
3040 3038
3041 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3039 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3042 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3040 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3043 for (; it != swap_promise_monitor_.end(); it++) 3041 for (; it != swap_promise_monitor_.end(); it++)
3044 (*it)->OnSetNeedsRedrawOnImpl(); 3042 (*it)->OnSetNeedsRedrawOnImpl();
3045 } 3043 }
3046 3044
3047 } // namespace cc 3045 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698