summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-18 23:34:51 +0000
committerajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-18 23:34:51 +0000
commit1c24cf2967fb6e1d01da8c044c40542bf164a8b1 (patch)
treeaeb61f7c38c395ee4bece693728648992020ea65 /cc/layers
parent9036babe3679effab6558c5e258a3fc4bbc185d1 (diff)
downloadchromium_src-1c24cf2967fb6e1d01da8c044c40542bf164a8b1.zip
chromium_src-1c24cf2967fb6e1d01da8c044c40542bf164a8b1.tar.gz
chromium_src-1c24cf2967fb6e1d01da8c044c40542bf164a8b1.tar.bz2
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
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/layer.cc10
-rw-r--r--cc/layers/layer.h1
-rw-r--r--cc/layers/layer_impl.cc2
-rw-r--r--cc/layers/layer_impl.h1
4 files changed, 10 insertions, 4 deletions
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<LayerAnimationController> 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<Layer>,
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.