Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 948243003: cc: Misc animation refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address danakj's comment. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e13da9acd87222a76f6637c69ab945e3c1d40952..2f11adcfc4d74332408b93e5fb0cff6627c7b494 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3121,31 +3121,26 @@ void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
return;
TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers");
- AnimationRegistrar::AnimationControllerMap copy =
+ AnimationRegistrar::AnimationControllerMap controllers_copy =
animation_registrar_->active_animation_controllers();
- for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
- iter != copy.end();
- ++iter)
- (*iter).second->Animate(monotonic_time);
+ for (auto& it : controllers_copy)
+ it.second->Animate(monotonic_time);
SetNeedsAnimate();
}
void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) {
- if (!settings_.accelerated_animation_enabled ||
- !needs_animate_layers() ||
+ if (!settings_.accelerated_animation_enabled || !needs_animate_layers() ||
!active_tree_->root_layer())
return;
TRACE_EVENT0("cc", "LayerTreeHostImpl::UpdateAnimationState");
scoped_ptr<AnimationEventsVector> events =
make_scoped_ptr(new AnimationEventsVector);
- AnimationRegistrar::AnimationControllerMap copy =
+ AnimationRegistrar::AnimationControllerMap active_controllers_copy =
animation_registrar_->active_animation_controllers();
- for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
- iter != copy.end();
- ++iter)
- (*iter).second->UpdateState(start_ready_animations, events.get());
+ for (auto& it : active_controllers_copy)
+ it.second->UpdateState(start_ready_animations, events.get());
if (!events->empty()) {
client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass());
@@ -3160,12 +3155,10 @@ void LayerTreeHostImpl::ActivateAnimations() {
return;
TRACE_EVENT0("cc", "LayerTreeHostImpl::ActivateAnimations");
- AnimationRegistrar::AnimationControllerMap copy =
+ AnimationRegistrar::AnimationControllerMap active_controllers_copy =
animation_registrar_->active_animation_controllers();
- for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
- iter != copy.end();
- ++iter)
- (*iter).second->ActivateAnimations();
+ for (auto& it : active_controllers_copy)
+ it.second->ActivateAnimations();
SetNeedsAnimate();
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698