| Index: cc/layers/layer_impl.cc
|
| diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
|
| index aeb1c6fbff34691213f62cdd554103d7042a2848..f08cc754fbf6ad0641f9046a257cfeeef2bd338a 100644
|
| --- a/cc/layers/layer_impl.cc
|
| +++ b/cc/layers/layer_impl.cc
|
| @@ -8,7 +8,6 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "base/trace_event/trace_event_argument.h"
|
| -#include "cc/animation/animation_registrar.h"
|
| #include "cc/animation/scrollbar_animation_controller.h"
|
| #include "cc/base/math_util.h"
|
| #include "cc/base/simple_enclosed_region.h"
|
| @@ -86,28 +85,12 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
|
| DCHECK(layer_tree_impl_);
|
| layer_tree_impl_->RegisterLayer(this);
|
|
|
| - if (!layer_tree_impl_->settings().use_compositor_animation_timelines) {
|
| - AnimationRegistrar* registrar = layer_tree_impl_->GetAnimationRegistrar();
|
| - layer_animation_controller_ =
|
| - registrar->GetAnimationControllerForId(layer_id_);
|
| - layer_animation_controller_->AddValueObserver(this);
|
| - if (IsActive()) {
|
| - layer_animation_controller_->set_value_provider(this);
|
| - layer_animation_controller_->set_layer_animation_delegate(this);
|
| - }
|
| - }
|
| SetNeedsPushProperties();
|
| }
|
|
|
| LayerImpl::~LayerImpl() {
|
| DCHECK_EQ(DRAW_MODE_NONE, current_draw_mode_);
|
|
|
| - if (layer_animation_controller_) {
|
| - layer_animation_controller_->RemoveValueObserver(this);
|
| - layer_animation_controller_->remove_value_provider(this);
|
| - layer_animation_controller_->remove_layer_animation_delegate(this);
|
| - }
|
| -
|
| if (!copy_requests_.empty() && layer_tree_impl_->IsActiveTree())
|
| layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this);
|
| layer_tree_impl_->UnregisterLayer(this);
|
| @@ -824,8 +807,6 @@ void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) {
|
| layer_tree_impl_->DidAnimateScrollOffset();
|
| }
|
|
|
| -void LayerImpl::OnAnimationWaitingForDeletion() {}
|
| -
|
| bool LayerImpl::IsActive() const {
|
| return layer_tree_impl_->IsActiveTree();
|
| }
|
| @@ -974,19 +955,11 @@ void LayerImpl::SetFilters(const FilterOperations& filters) {
|
| }
|
|
|
| bool LayerImpl::FilterIsAnimating() const {
|
| - return layer_animation_controller_
|
| - ? layer_animation_controller_->IsAnimatingProperty(
|
| - Animation::FILTER)
|
| - : layer_tree_impl_->IsAnimatingFilterProperty(this);
|
| + return layer_tree_impl_->IsAnimatingFilterProperty(this);
|
| }
|
|
|
| bool LayerImpl::FilterIsAnimatingOnImplOnly() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->FilterIsAnimatingOnImplOnly(this);
|
| -
|
| - Animation* filter_animation =
|
| - layer_animation_controller_->GetAnimation(Animation::FILTER);
|
| - return filter_animation && filter_animation->is_impl_only();
|
| + return layer_tree_impl_->FilterIsAnimatingOnImplOnly(this);
|
| }
|
|
|
| void LayerImpl::SetBackgroundFilters(
|
| @@ -1023,31 +996,15 @@ void LayerImpl::SetOpacity(float opacity) {
|
| }
|
|
|
| bool LayerImpl::OpacityIsAnimating() const {
|
| - return layer_animation_controller_
|
| - ? layer_animation_controller_->IsAnimatingProperty(
|
| - Animation::OPACITY)
|
| - : layer_tree_impl_->IsAnimatingOpacityProperty(this);
|
| + return layer_tree_impl_->IsAnimatingOpacityProperty(this);
|
| }
|
|
|
| bool LayerImpl::HasPotentiallyRunningOpacityAnimation() const {
|
| - if (layer_animation_controller_) {
|
| - if (Animation* animation =
|
| - layer_animation_controller()->GetAnimation(Animation::OPACITY)) {
|
| - return !animation->is_finished();
|
| - }
|
| - return false;
|
| - } else {
|
| - return layer_tree_impl_->HasPotentiallyRunningOpacityAnimation(this);
|
| - }
|
| + return layer_tree_impl_->HasPotentiallyRunningOpacityAnimation(this);
|
| }
|
|
|
| bool LayerImpl::OpacityIsAnimatingOnImplOnly() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->OpacityIsAnimatingOnImplOnly(this);
|
| -
|
| - Animation* opacity_animation =
|
| - layer_animation_controller_->GetAnimation(Animation::OPACITY);
|
| - return opacity_animation && opacity_animation->is_impl_only();
|
| + return layer_tree_impl_->OpacityIsAnimatingOnImplOnly(this);
|
| }
|
|
|
| void LayerImpl::SetBlendMode(SkXfermode::Mode blend_mode) {
|
| @@ -1123,83 +1080,45 @@ void LayerImpl::SetTransformAndInvertibility(const gfx::Transform& transform,
|
| }
|
|
|
| bool LayerImpl::TransformIsAnimating() const {
|
| - return layer_animation_controller_
|
| - ? layer_animation_controller_->IsAnimatingProperty(
|
| - Animation::TRANSFORM)
|
| - : layer_tree_impl_->IsAnimatingTransformProperty(this);
|
| + return layer_tree_impl_->IsAnimatingTransformProperty(this);
|
| }
|
|
|
| bool LayerImpl::HasPotentiallyRunningTransformAnimation() const {
|
| - if (layer_animation_controller_) {
|
| - if (Animation* animation =
|
| - layer_animation_controller()->GetAnimation(Animation::TRANSFORM)) {
|
| - return !animation->is_finished();
|
| - }
|
| - return false;
|
| - } else {
|
| - return layer_tree_impl_->HasPotentiallyRunningTransformAnimation(this);
|
| - }
|
| + return layer_tree_impl_->HasPotentiallyRunningTransformAnimation(this);
|
| }
|
|
|
| bool LayerImpl::TransformIsAnimatingOnImplOnly() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->TransformIsAnimatingOnImplOnly(this);
|
| -
|
| - Animation* transform_animation =
|
| - layer_animation_controller_->GetAnimation(Animation::TRANSFORM);
|
| - return transform_animation && transform_animation->is_impl_only();
|
| + return layer_tree_impl_->TransformIsAnimatingOnImplOnly(this);
|
| }
|
|
|
| bool LayerImpl::HasOnlyTranslationTransforms() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->HasOnlyTranslationTransforms(this);
|
| -
|
| - return layer_animation_controller_->HasOnlyTranslationTransforms();
|
| + return layer_tree_impl_->HasOnlyTranslationTransforms(this);
|
| }
|
|
|
| bool LayerImpl::MaximumTargetScale(float* max_scale) const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->MaximumTargetScale(this, max_scale);
|
| -
|
| - return layer_animation_controller_->MaximumTargetScale(max_scale);
|
| + return layer_tree_impl_->MaximumTargetScale(this, max_scale);
|
| }
|
|
|
| bool LayerImpl::HasFilterAnimationThatInflatesBounds() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->HasFilterAnimationThatInflatesBounds(this);
|
| -
|
| - return layer_animation_controller_->HasFilterAnimationThatInflatesBounds();
|
| + return layer_tree_impl_->HasFilterAnimationThatInflatesBounds(this);
|
| }
|
|
|
| bool LayerImpl::HasTransformAnimationThatInflatesBounds() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->HasTransformAnimationThatInflatesBounds(this);
|
| -
|
| - return layer_animation_controller_->HasTransformAnimationThatInflatesBounds();
|
| + return layer_tree_impl_->HasTransformAnimationThatInflatesBounds(this);
|
| }
|
|
|
| bool LayerImpl::HasAnimationThatInflatesBounds() const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->HasAnimationThatInflatesBounds(this);
|
| -
|
| - return layer_animation_controller_->HasAnimationThatInflatesBounds();
|
| + return layer_tree_impl_->HasAnimationThatInflatesBounds(this);
|
| }
|
|
|
| bool LayerImpl::FilterAnimationBoundsForBox(const gfx::BoxF& box,
|
| gfx::BoxF* bounds) const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->FilterAnimationBoundsForBox(this, box, bounds);
|
| -
|
| - return layer_animation_controller_->FilterAnimationBoundsForBox(box, bounds);
|
| + return layer_tree_impl_->FilterAnimationBoundsForBox(this, box, bounds);
|
| }
|
|
|
| bool LayerImpl::TransformAnimationBoundsForBox(const gfx::BoxF& box,
|
| gfx::BoxF* bounds) const {
|
| - if (!layer_animation_controller_)
|
| - return layer_tree_impl_->TransformAnimationBoundsForBox(this, box, bounds);
|
| -
|
| - return layer_animation_controller_->TransformAnimationBoundsForBox(box,
|
| - bounds);
|
| + return layer_tree_impl_->TransformAnimationBoundsForBox(this, box, bounds);
|
| }
|
|
|
| void LayerImpl::SetUpdateRect(const gfx::Rect& update_rect) {
|
| @@ -1644,11 +1563,8 @@ void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
|
| state->SetBoolean("can_use_lcd_text", can_use_lcd_text());
|
| state->SetBoolean("contents_opaque", contents_opaque());
|
|
|
| - state->SetBoolean(
|
| - "has_animation_bounds",
|
| - layer_animation_controller_
|
| - ? layer_animation_controller_->HasAnimationThatInflatesBounds()
|
| - : layer_tree_impl_->HasAnimationThatInflatesBounds(this));
|
| + state->SetBoolean("has_animation_bounds",
|
| + layer_tree_impl_->HasAnimationThatInflatesBounds(this));
|
|
|
| gfx::BoxF box;
|
| if (LayerUtils::GetAnimationBounds(*this, &box))
|
| @@ -1701,14 +1617,6 @@ int LayerImpl::NumDescendantsThatDrawContent() const {
|
| return num_descendants_that_draw_content_;
|
| }
|
|
|
| -void LayerImpl::NotifyAnimationFinished(
|
| - base::TimeTicks monotonic_time,
|
| - Animation::TargetProperty target_property,
|
| - int group) {
|
| - if (target_property == Animation::SCROLL_OFFSET)
|
| - layer_tree_impl_->InputScrollAnimationFinished();
|
| -}
|
| -
|
| void LayerImpl::SetHasRenderSurface(bool should_have_render_surface) {
|
| if (!!render_surface() == should_have_render_surface)
|
| return;
|
|
|