| Index: cc/trees/layer_tree_host.cc
|
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
|
| index 9a1b5d37b9b7b53f764e6e0273f14353212f2f88..1dae39ede931f2b1fbab5536a90e9a070d41406e 100644
|
| --- a/cc/trees/layer_tree_host.cc
|
| +++ b/cc/trees/layer_tree_host.cc
|
| @@ -20,8 +20,6 @@
|
| #include "base/trace_event/trace_event.h"
|
| #include "base/trace_event/trace_event_argument.h"
|
| #include "cc/animation/animation_host.h"
|
| -#include "cc/animation/animation_registrar.h"
|
| -#include "cc/animation/layer_animation_controller.h"
|
| #include "cc/base/math_util.h"
|
| #include "cc/debug/devtools_instrumentation.h"
|
| #include "cc/debug/frame_viewer_instrumentation.h"
|
| @@ -132,16 +130,11 @@ LayerTreeHost::LayerTreeHost(
|
| task_graph_runner_(task_graph_runner),
|
| surface_id_namespace_(0u),
|
| next_surface_sequence_(1u) {
|
| - if (settings_.accelerated_animation_enabled &&
|
| - !settings.use_compositor_animation_timelines)
|
| - animation_registrar_ = AnimationRegistrar::Create();
|
| rendering_stats_instrumentation_->set_record_rendering_stats(
|
| debug_state_.RecordRenderingStats());
|
|
|
| - if (settings_.use_compositor_animation_timelines) {
|
| - animation_host_ = AnimationHost::Create(false);
|
| - animation_host_->SetLayerTreeMutatorsClient(this);
|
| - }
|
| + animation_host_ = AnimationHost::Create(false);
|
| + animation_host_->SetLayerTreeMutatorsClient(this);
|
| }
|
|
|
| void LayerTreeHost::InitializeThreaded(
|
| @@ -175,13 +168,8 @@ void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) {
|
| proxy_ = proxy.Pass();
|
| proxy_->Start();
|
| if (settings_.accelerated_animation_enabled) {
|
| - if (animation_registrar_)
|
| - animation_registrar_->set_supports_scroll_animations(
|
| - proxy_->SupportsImplScrolling());
|
| -
|
| - if (animation_host_)
|
| - animation_host_->SetSupportsScrollAnimations(
|
| - proxy_->SupportsImplScrolling());
|
| + animation_host_->SetSupportsScrollAnimations(
|
| + proxy_->SupportsImplScrolling());
|
| }
|
| }
|
|
|
| @@ -565,10 +553,7 @@ void LayerTreeHost::SetNextCommitForcesRedraw() {
|
| void LayerTreeHost::SetAnimationEvents(
|
| scoped_ptr<AnimationEventsVector> events) {
|
| DCHECK(proxy_->IsMainThread());
|
| - if (animation_host_)
|
| - animation_host_->SetAnimationEvents(events.Pass());
|
| - else
|
| - animation_registrar_->SetAnimationEvents(events.Pass());
|
| + animation_host_->SetAnimationEvents(events.Pass());
|
| }
|
|
|
| void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) {
|
| @@ -1173,13 +1158,8 @@ void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) {
|
| return;
|
|
|
| AnimationEventsVector events;
|
| - 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 (animation_host_->AnimateLayers(monotonic_time))
|
| + animation_host_->UpdateAnimationState(true, &events);
|
|
|
| if (!events.empty())
|
| property_trees_.needs_rebuild = true;
|
| @@ -1353,7 +1333,7 @@ void LayerTreeHost::SetMutatorsNeedCommit() {
|
| void LayerTreeHost::SetLayerFilterMutated(int layer_id,
|
| bool active_tree,
|
| const FilterOperations& filters) {
|
| - LayerAnimationValueObserver* layer = LayerById(layer_id);
|
| + Layer* layer = LayerById(layer_id);
|
| DCHECK(layer);
|
| layer->OnFilterAnimated(filters);
|
| }
|
| @@ -1361,7 +1341,7 @@ void LayerTreeHost::SetLayerFilterMutated(int layer_id,
|
| void LayerTreeHost::SetLayerOpacityMutated(int layer_id,
|
| bool active_tree,
|
| float opacity) {
|
| - LayerAnimationValueObserver* layer = LayerById(layer_id);
|
| + Layer* layer = LayerById(layer_id);
|
| DCHECK(layer);
|
| layer->OnOpacityAnimated(opacity);
|
| }
|
| @@ -1369,7 +1349,7 @@ void LayerTreeHost::SetLayerOpacityMutated(int layer_id,
|
| void LayerTreeHost::SetLayerTransformMutated(int layer_id,
|
| bool active_tree,
|
| const gfx::Transform& transform) {
|
| - LayerAnimationValueObserver* layer = LayerById(layer_id);
|
| + Layer* layer = LayerById(layer_id);
|
| DCHECK(layer);
|
| layer->OnTransformAnimated(transform);
|
| }
|
| @@ -1378,73 +1358,55 @@ void LayerTreeHost::SetLayerScrollOffsetMutated(
|
| int layer_id,
|
| bool active_tree,
|
| const gfx::ScrollOffset& scroll_offset) {
|
| - LayerAnimationValueObserver* layer = LayerById(layer_id);
|
| - DCHECK(layer);
|
| - layer->OnScrollOffsetAnimated(scroll_offset);
|
| + // Do nothing. Scroll deltas will be sent from the compositor thread back
|
| + // to the main thread in the same manner as during non-animated
|
| + // compositor-driven scrolling.
|
| }
|
|
|
| gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation(
|
| int layer_id) const {
|
| - LayerAnimationValueProvider* layer = LayerById(layer_id);
|
| + Layer* layer = LayerById(layer_id);
|
| DCHECK(layer);
|
| return layer->ScrollOffsetForAnimation();
|
| }
|
|
|
| bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted(
|
| const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id())
|
| - : false;
|
| + return animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->IsAnimatingFilterProperty(layer->id())
|
| - : false;
|
| + return animation_host_->IsAnimatingFilterProperty(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::IsAnimatingOpacityProperty(const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->IsAnimatingOpacityProperty(layer->id())
|
| - : false;
|
| + return animation_host_->IsAnimatingOpacityProperty(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::IsAnimatingTransformProperty(const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->IsAnimatingTransformProperty(layer->id())
|
| - : false;
|
| + return animation_host_->IsAnimatingTransformProperty(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::HasPotentiallyRunningOpacityAnimation(
|
| const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->HasPotentiallyRunningOpacityAnimation(
|
| - layer->id())
|
| - : false;
|
| + return animation_host_->HasPotentiallyRunningOpacityAnimation(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::HasPotentiallyRunningTransformAnimation(
|
| const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->HasPotentiallyRunningTransformAnimation(
|
| - layer->id())
|
| - : false;
|
| + return animation_host_->HasPotentiallyRunningTransformAnimation(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::AnimationsPreserveAxisAlignment(const Layer* layer) const {
|
| - return animation_host_
|
| - ? animation_host_->AnimationsPreserveAxisAlignment(layer->id())
|
| - : true;
|
| + return animation_host_->AnimationsPreserveAxisAlignment(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::HasAnyAnimation(const Layer* layer) const {
|
| - return animation_host_ ? animation_host_->HasAnyAnimation(layer->id())
|
| - : false;
|
| + return animation_host_->HasAnyAnimation(layer->id());
|
| }
|
|
|
| bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const {
|
| - return animation_host_ ? animation_host_->HasActiveAnimation(layer->id())
|
| - : false;
|
| + return animation_host_->HasActiveAnimation(layer->id());
|
| }
|
|
|
| } // namespace cc
|
|
|