From 1c24cf2967fb6e1d01da8c044c40542bf164a8b1 Mon Sep 17 00:00:00 2001 From: "ajuma@chromium.org" Date: Mon, 18 Nov 2013 23:34:51 +0000 Subject: Don't PushProperties every commit for animating layers This removes the need to PushProperties every commit during an animation. Instead, a single PushProperties is needed whenever there are animations waiting for deletion. This also removes LayerAnimationController::set_force_sync, which no longer had any non-test callers and wasn't actually needed by its test callers. BUG=259088 Review URL: https://codereview.chromium.org/60083018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235845 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/layers/layer.cc | 10 ++++++---- cc/layers/layer.h | 1 + cc/layers/layer_impl.cc | 2 ++ cc/layers/layer_impl.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'cc/layers') diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 8d07366..e0ffb5c 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -927,9 +927,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { stacking_order_changed_ = false; update_rect_ = gfx::RectF(); - // Animating layers require further push properties to clean up the animation. - // crbug.com/259088 - needs_push_properties_ = layer_animation_controller_->has_any_animation(); + needs_push_properties_ = false; num_dependents_need_push_properties_ = 0; } @@ -998,6 +996,11 @@ void Layer::OnTransformAnimated(const gfx::Transform& transform) { transform_ = transform; } +void Layer::OnAnimationWaitingForDeletion() { + // Animations are only deleted during PushProperties. + SetNeedsPushProperties(); +} + bool Layer::IsActive() const { return true; } @@ -1027,7 +1030,6 @@ void Layer::SetLayerAnimationControllerForTest( scoped_refptr controller) { layer_animation_controller_->RemoveValueObserver(this); layer_animation_controller_ = controller; - layer_animation_controller_->set_force_sync(); layer_animation_controller_->AddValueObserver(this); SetNeedsCommit(); } diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 889e09ba..b552a35 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -522,6 +522,7 @@ class CC_EXPORT Layer : public base::RefCounted, virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; virtual void OnOpacityAnimated(float opacity) OVERRIDE; virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; + virtual void OnAnimationWaitingForDeletion() OVERRIDE; virtual bool IsActive() const OVERRIDE; LayerList children_; diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 1033b61..99f9502 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -694,6 +694,8 @@ void LayerImpl::OnTransformAnimated(const gfx::Transform& transform) { SetTransform(transform); } +void LayerImpl::OnAnimationWaitingForDeletion() {} + bool LayerImpl::IsActive() const { return layer_tree_impl_->IsActiveTree(); } diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index e774dfa..6d06b6d2 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -76,6 +76,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; virtual void OnOpacityAnimated(float opacity) OVERRIDE; virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; + virtual void OnAnimationWaitingForDeletion() OVERRIDE; virtual bool IsActive() const OVERRIDE; // Tree structure. -- cgit v1.1