diff options
author | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 08:10:00 +0000 |
---|---|---|
committer | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 08:10:00 +0000 |
commit | 40880faa21a0a9ac7365437748c98358290319b6 (patch) | |
tree | bff3ed39938cf895b86af61a0a48816274ac75c3 /cc/test/layer_tree_test.cc | |
parent | c817ad70e0927459d06045e4be82cc0719c39529 (diff) | |
download | chromium_src-40880faa21a0a9ac7365437748c98358290319b6.zip chromium_src-40880faa21a0a9ac7365437748c98358290319b6.tar.gz chromium_src-40880faa21a0a9ac7365437748c98358290319b6.tar.bz2 |
De-activate LayerAnimationControllers when all animations are WaitingForDeletion
Animations that are in the WaitingForDeletion state cannot make any
further progress, so we do not need to tick LayerAnimationControllers that
only have such animations.
BUG=319557
Review URL: https://codereview.chromium.org/73343002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_tree_test.cc')
-rw-r--r-- | cc/test/layer_tree_test.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 1437f2c..7d4b517 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -375,16 +375,28 @@ void LayerTreeTest::PostAddAnimationToMainThread( FROM_HERE, base::Bind(&LayerTreeTest::DispatchAddAnimation, main_thread_weak_ptr_, - base::Unretained(layer_to_receive_animation))); + base::Unretained(layer_to_receive_animation), + 0.000001)); } void LayerTreeTest::PostAddInstantAnimationToMainThread( Layer* layer_to_receive_animation) { main_task_runner_->PostTask( FROM_HERE, - base::Bind(&LayerTreeTest::DispatchAddInstantAnimation, + base::Bind(&LayerTreeTest::DispatchAddAnimation, + main_thread_weak_ptr_, + base::Unretained(layer_to_receive_animation), + 0.0)); +} + +void LayerTreeTest::PostAddLongAnimationToMainThread( + Layer* layer_to_receive_animation) { + main_task_runner_->PostTask( + FROM_HERE, + base::Bind(&LayerTreeTest::DispatchAddAnimation, main_thread_weak_ptr_, - base::Unretained(layer_to_receive_animation))); + base::Unretained(layer_to_receive_animation), + 1.0)); } void LayerTreeTest::PostSetNeedsCommitToMainThread() { @@ -502,25 +514,13 @@ void LayerTreeTest::RealEndTest() { base::MessageLoop::current()->Quit(); } -void LayerTreeTest::DispatchAddInstantAnimation( - Layer* layer_to_receive_animation) { - DCHECK(!proxy() || proxy()->IsMainThread()); - - if (layer_to_receive_animation) { - AddOpacityTransitionToLayer(layer_to_receive_animation, - 0, - 0, - 0.5, - false); - } -} - -void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation) { +void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, + double animation_duration) { DCHECK(!proxy() || proxy()->IsMainThread()); if (layer_to_receive_animation) { AddOpacityTransitionToLayer(layer_to_receive_animation, - 0.000001, + animation_duration, 0, 0.5, true); |