summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-08-19 17:14:40 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-20 00:15:45 +0000
commit047d089868e2fd203b2df1248e0320bba469180e (patch)
tree9479be8bc97fa9f25b65a9b245965df0d275fd95 /cc
parent9bba4ce900c4bb181c1278802f4413b3a2563c2b (diff)
downloadchromium_src-047d089868e2fd203b2df1248e0320bba469180e.zip
chromium_src-047d089868e2fd203b2df1248e0320bba469180e.tar.gz
chromium_src-047d089868e2fd203b2df1248e0320bba469180e.tar.bz2
cc: Don't UpdateAnimationState when not visible or can't draw.
This is code added for background ticking, which has since been removed. Kill the two tests verifying that this worked, as we don't care to support animations when we're not compositing anymore. R=ajuma BUG=522658 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1298423004 Cr-Commit-Position: refs/heads/master@{#344379}
Diffstat (limited to 'cc')
-rw-r--r--cc/trees/layer_tree_host_impl.cc7
-rw-r--r--cc/trees/layer_tree_host_unittest_animation.cc44
-rw-r--r--cc/trees/layer_tree_host_unittest_animation_timelines.cc47
3 files changed, 0 insertions, 98 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2612539..f8d568f 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -441,13 +441,6 @@ void LayerTreeHostImpl::Animate() {
AnimateLayers(monotonic_time);
AnimateScrollbars(monotonic_time);
AnimateTopControls(monotonic_time);
-
- // If animations are not visible, update the state now as Draw/Swap will never
- // occur.
- // TODO(ajuma): Left-overs from now-deleted background ticking?
- bool animations_are_visible = visible() && CanDraw();
- if (!animations_are_visible)
- UpdateAnimationState(true);
}
bool LayerTreeHostImpl::PrepareTiles() {
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 72f1073..ef27f16 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -548,49 +548,6 @@ class LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit
MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit);
-// Make sure the main thread can still execute animations when CanDraw() is not
-// true.
-class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw
- : public LayerTreeHostAnimationTest {
- public:
- LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw() : started_times_(0) {}
-
- void SetupTree() override {
- LayerTreeHostAnimationTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
- picture_->SetBounds(gfx::Size(4, 4));
- picture_->set_layer_animation_delegate(this);
- layer_tree_host()->root_layer()->AddChild(picture_);
- }
-
- void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size());
- PostAddAnimationToMainThread(picture_.get());
- }
-
- void NotifyAnimationStarted(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
- int group) override {
- started_times_++;
- }
-
- void NotifyAnimationFinished(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
- int group) override {
- EndTest();
- }
-
- void AfterTest() override { EXPECT_EQ(1, started_times_); }
-
- private:
- int started_times_;
- FakeContentLayerClient client_;
- scoped_refptr<FakePictureLayer> picture_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw);
-
// Animations should not be started when frames are being skipped due to
// checkerboard.
class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
@@ -1164,7 +1121,6 @@ class LayerTreeHostAnimationTestNotifyAnimationFinished
}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size());
PostAddLongAnimationToMainThread(picture_.get());
}
diff --git a/cc/trees/layer_tree_host_unittest_animation_timelines.cc b/cc/trees/layer_tree_host_unittest_animation_timelines.cc
index 472aa98..448b2f4 100644
--- a/cc/trees/layer_tree_host_unittest_animation_timelines.cc
+++ b/cc/trees/layer_tree_host_unittest_animation_timelines.cc
@@ -444,53 +444,6 @@ class LayerTreeHostTimelinesTestLayerAddedWithAnimation
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTimelinesTestLayerAddedWithAnimation);
-// Make sure the main thread can still execute animations when CanDraw() is not
-// true.
-// Evolved from LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw
-class LayerTreeHostTimelinesTestRunAnimationWhenNotCanDraw
- : public LayerTreeHostTimelinesTest {
- public:
- LayerTreeHostTimelinesTestRunAnimationWhenNotCanDraw() : started_times_(0) {}
-
- void SetupTree() override {
- LayerTreeHostTimelinesTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
- picture_->SetBounds(gfx::Size(4, 4));
- layer_tree_host()->root_layer()->AddChild(picture_);
-
- AttachPlayersToTimeline();
- player_child_->AttachLayer(picture_->id());
- player_child_->set_layer_animation_delegate(this);
- }
-
- void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size());
- PostAddAnimationToMainThreadPlayer(player_child_.get());
- }
-
- void NotifyAnimationStarted(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
- int group) override {
- started_times_++;
- }
-
- void NotifyAnimationFinished(base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property,
- int group) override {
- EndTest();
- }
-
- void AfterTest() override { EXPECT_EQ(1, started_times_); }
-
- private:
- int started_times_;
- FakeContentLayerClient client_;
- scoped_refptr<FakePictureLayer> picture_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostTimelinesTestRunAnimationWhenNotCanDraw);
-
// Animations should not be started when frames are being skipped due to
// checkerboard.
// Evolved from LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations.