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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index d893b33c3374787a4dd4c8ff18e61bf0dce27e8c..2ac7ebe5b413b97a3b82e1f3cffb58d0e5a213ce 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -544,34 +544,7 @@ void LayerTreeHost::SetNextCommitForcesRedraw() {
void LayerTreeHost::SetAnimationEvents(
scoped_ptr<AnimationEventsVector> events) {
DCHECK(proxy_->IsMainThread());
- for (size_t event_index = 0; event_index < events->size(); ++event_index) {
- int event_layer_id = (*events)[event_index].layer_id;
-
- // Use the map of all controllers, not just active ones, since non-active
- // controllers may still receive events for impl-only animations.
- const AnimationRegistrar::AnimationControllerMap& animation_controllers =
- animation_registrar_->all_animation_controllers();
- auto iter = animation_controllers.find(event_layer_id);
- if (iter != animation_controllers.end()) {
- switch ((*events)[event_index].type) {
- case AnimationEvent::STARTED:
- (*iter).second->NotifyAnimationStarted((*events)[event_index]);
- break;
-
- case AnimationEvent::FINISHED:
- (*iter).second->NotifyAnimationFinished((*events)[event_index]);
- break;
-
- case AnimationEvent::ABORTED:
- (*iter).second->NotifyAnimationAborted((*events)[event_index]);
- break;
-
- case AnimationEvent::PROPERTY_UPDATE:
- (*iter).second->NotifyAnimationPropertyUpdate((*events)[event_index]);
- break;
- }
- }
- }
+ animation_registrar_->SetAnimationEvents(events.Pass());
}
void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) {
@@ -1165,26 +1138,12 @@ void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints,
animate));
}
-void LayerTreeHost::AsValueInto(base::trace_event::TracedValue* state) const {
- state->BeginDictionary("proxy");
- proxy_->AsValueInto(state);
- state->EndDictionary();
-}
-
void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) {
- if (!settings_.accelerated_animation_enabled ||
- animation_registrar_->active_animation_controllers().empty())
+ if (!settings_.accelerated_animation_enabled)
return;
- TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers");
-
- AnimationRegistrar::AnimationControllerMap active_controllers_copy =
- animation_registrar_->active_animation_controllers();
- for (auto& it : active_controllers_copy) {
- it.second->Animate(monotonic_time);
- bool start_ready_animations = true;
- it.second->UpdateState(start_ready_animations, NULL);
- }
+ if (animation_registrar_->AnimateLayers(monotonic_time))
+ animation_registrar_->UpdateAnimationState(true, NULL);
}
UIResourceId LayerTreeHost::CreateUIResource(UIResourceClient* client) {
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698