Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index fc3d8919fb2ddafed326fdc2ee71fb4fcacc0a32..35151a7d4e43363c73c0312c1a335bdcff4c74c8 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()); |
} |
} |
@@ -556,7 +562,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) { |
@@ -1155,8 +1164,13 @@ void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) { |
if (!settings_.accelerated_animation_enabled) |
return; |
- if (animation_registrar_->AnimateLayers(monotonic_time)) |
- animation_registrar_->UpdateAnimationState(true, NULL); |
+ if (animation_host_) { |
+ if (animation_host_->AnimateLayers(monotonic_time)) |
+ animation_host_->UpdateAnimationState(true, NULL); |
+ } else if (animation_registrar_) { |
+ if (animation_registrar_->AnimateLayers(monotonic_time)) |
+ animation_registrar_->UpdateAnimationState(true, NULL); |
+ } |
} |
UIResourceId LayerTreeHost::CreateUIResource(UIResourceClient* client) { |
@@ -1359,4 +1373,38 @@ void LayerTreeHost::SetLayerScrollOffsetMutated( |
layer->OnScrollOffsetAnimated(scroll_offset); |
} |
+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::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 |