Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index 0461aa03a06ada637e8928dec68fa4001321aa40..c33602307b1f21b2f8b21144cab7b7ec9b7c3b80 100644 |
--- a/cc/trees/layer_tree_host.cc |
+++ b/cc/trees/layer_tree_host.cc |
@@ -132,7 +132,8 @@ LayerTreeHost::LayerTreeHost( |
task_graph_runner_(task_graph_runner), |
surface_id_namespace_(0u), |
next_surface_sequence_(1u) { |
- if (settings_.accelerated_animation_enabled) |
+ if (settings_.accelerated_animation_enabled && |
+ !settings.use_compositor_animation_timelines) |
animation_registrar_ = AnimationRegistrar::Create(); |
rendering_stats_instrumentation_->set_record_rendering_stats( |
debug_state_.RecordRenderingStats()); |
@@ -174,8 +175,13 @@ void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
proxy_ = proxy.Pass(); |
proxy_->Start(); |
if (settings_.accelerated_animation_enabled) { |
- animation_registrar_->set_supports_scroll_animations( |
- proxy_->SupportsImplScrolling()); |
+ if (animation_registrar_) |
+ animation_registrar_->set_supports_scroll_animations( |
+ proxy_->SupportsImplScrolling()); |
+ |
+ if (animation_host_) |
+ animation_host_->SetSupportsScrollAnimations( |
+ proxy_->SupportsImplScrolling()); |
} |
} |
@@ -559,7 +565,10 @@ void LayerTreeHost::SetNextCommitForcesRedraw() { |
void LayerTreeHost::SetAnimationEvents( |
scoped_ptr<AnimationEventsVector> events) { |
DCHECK(proxy_->IsMainThread()); |
- animation_registrar_->SetAnimationEvents(events.Pass()); |
+ if (animation_host_) |
+ animation_host_->SetAnimationEvents(events.Pass()); |
+ else |
+ animation_registrar_->SetAnimationEvents(events.Pass()); |
} |
void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) { |
@@ -1164,11 +1173,16 @@ void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) { |
return; |
AnimationEventsVector events; |
- if (animation_registrar_->AnimateLayers(monotonic_time)) { |
- animation_registrar_->UpdateAnimationState(true, &events); |
- if (!events.empty()) |
- property_trees_.needs_rebuild = true; |
+ if (animation_host_) { |
+ if (animation_host_->AnimateLayers(monotonic_time)) |
+ animation_host_->UpdateAnimationState(true, &events); |
+ } else if (animation_registrar_) { |
+ if (animation_registrar_->AnimateLayers(monotonic_time)) |
+ animation_registrar_->UpdateAnimationState(true, &events); |
} |
+ |
+ if (!events.empty()) |
+ property_trees_.needs_rebuild = true; |
} |
UIResourceId LayerTreeHost::CreateUIResource(UIResourceClient* client) { |
@@ -1369,4 +1383,61 @@ void LayerTreeHost::SetLayerScrollOffsetMutated( |
layer->OnScrollOffsetAnimated(scroll_offset); |
} |
+bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted( |
+ const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->IsAnimatingFilterProperty(layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::IsAnimatingOpacityProperty(const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->IsAnimatingOpacityProperty(layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::IsAnimatingTransformProperty(const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->IsAnimatingTransformProperty(layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::HasPotentiallyRunningOpacityAnimation( |
+ const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->HasPotentiallyRunningOpacityAnimation( |
+ layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::HasPotentiallyRunningTransformAnimation( |
+ const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->HasPotentiallyRunningTransformAnimation( |
+ layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::AnimationsPreserveAxisAlignment(const Layer* layer) const { |
+ return animation_host_ |
+ ? animation_host_->AnimationsPreserveAxisAlignment(layer->id()) |
+ : true; |
+} |
+ |
+bool LayerTreeHost::HasAnyAnimation(const Layer* layer) const { |
+ return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) |
+ : false; |
+} |
+ |
+bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { |
+ return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) |
+ : false; |
+} |
+ |
} // namespace cc |