Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: cc/trees/layer_tree_host_unittest_animation_timelines.cc

Issue 1409393005: CC Animations: Fix draw properties invalidation on LAC destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "cc/animation/animation_curve.h" 7 #include "cc/animation/animation_curve.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/animation/animation_player.h" 10 #include "cc/animation/animation_player.h"
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 private: 991 private:
992 scoped_refptr<Layer> layer_; 992 scoped_refptr<Layer> layer_;
993 FakeContentLayerClient client_; 993 FakeContentLayerClient client_;
994 CompletionEvent completion_; 994 CompletionEvent completion_;
995 }; 995 };
996 996
997 // An animation finishing during commit can only happen when we have a separate 997 // An animation finishing during commit can only happen when we have a separate
998 // compositor thread. 998 // compositor thread.
999 MULTI_THREAD_TEST_F(LayerTreeHostTimelinesTestAnimationFinishesDuringCommit); 999 MULTI_THREAD_TEST_F(LayerTreeHostTimelinesTestAnimationFinishesDuringCommit);
1000 1000
1001 #if defined(OS_ANDROID)
1002 #define MAYBE_LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction \
1003 DISABLED_LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction
1004 #else
1005 #define MAYBE_LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction \
1006 LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction
1007 #endif
1008
1009 // Check that SetTransformIsPotentiallyAnimatingChanged is called 1001 // Check that SetTransformIsPotentiallyAnimatingChanged is called
1010 // if we destroy LayerAnimationController and ElementAnimations. 1002 // if we destroy LayerAnimationController and ElementAnimations.
1011 class MAYBE_LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction 1003 class LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction
1012 : public LayerTreeHostTimelinesTest { 1004 : public LayerTreeHostTimelinesTest {
1013 public: 1005 public:
1014 void SetupTree() override { 1006 void SetupTree() override {
1015 LayerTreeHostTimelinesTest::SetupTree(); 1007 LayerTreeHostTimelinesTest::SetupTree();
1016 AttachPlayersToTimeline(); 1008 AttachPlayersToTimeline();
1017 player_->AttachLayer(layer_tree_host()->root_layer()->id()); 1009 player_->AttachLayer(layer_tree_host()->root_layer()->id());
1018 AddAnimatedTransformToPlayer(player_.get(), 1.0, 5, 5); 1010 AddAnimatedTransformToPlayer(player_.get(), 1.0, 5, 5);
1019 } 1011 }
1020 1012
1021 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 1013 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
1022 1014
1023 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 1015 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
1024 if (host_impl->active_tree()->source_frame_number() == 2) { 1016 if (host_impl->active_tree()->source_frame_number() == 1) {
Ian Vollick 2015/10/27 14:08:18 I'm sorry, it should probably be obvious to me, bu
loyso (OOO) 2015/10/27 22:43:46 Yes, your observation is correct. It worked only b
Ian Vollick 2015/10/28 22:54:42 Still a little confused (sorry). Could you add a l
1025 EXPECT_TRUE(host_impl->active_tree()); 1017 EXPECT_TRUE(host_impl->active_tree());
1026 EXPECT_TRUE(host_impl->active_tree()->root_layer()); 1018 EXPECT_TRUE(host_impl->active_tree()->root_layer());
1027 EXPECT_TRUE(host_impl->pending_tree()); 1019 EXPECT_TRUE(host_impl->pending_tree());
1028 EXPECT_TRUE(host_impl->pending_tree()->root_layer()); 1020 EXPECT_TRUE(host_impl->pending_tree()->root_layer());
1029 1021
1022 EXPECT_EQ(2, host_impl->pending_tree()->source_frame_number());
1023
1030 EXPECT_TRUE(host_impl->active_tree() 1024 EXPECT_TRUE(host_impl->active_tree()
1031 ->root_layer() 1025 ->root_layer()
1032 ->screen_space_transform_is_animating()); 1026 ->screen_space_transform_is_animating());
1033 EXPECT_FALSE(host_impl->pending_tree() 1027 EXPECT_FALSE(host_impl->pending_tree()
1034 ->root_layer() 1028 ->root_layer()
1035 ->screen_space_transform_is_animating()); 1029 ->screen_space_transform_is_animating());
1036 } 1030 }
1037 } 1031 }
1038 1032
1039 void WillCommit() override {}
1040
1041 void DidCommit() override { PostSetNeedsCommitToMainThread(); } 1033 void DidCommit() override { PostSetNeedsCommitToMainThread(); }
1042 1034
1043 void Layout() override { 1035 void Layout() override {
1044 if (layer_tree_host()->source_frame_number() == 2) { 1036 if (layer_tree_host()->source_frame_number() == 2) {
1045 // Destroy player. 1037 // Destroy player.
1046 timeline_->DetachPlayer(player_.get()); 1038 timeline_->DetachPlayer(player_.get());
1047 player_ = nullptr; 1039 player_ = nullptr;
1048 } 1040 }
1049 } 1041 }
1050 1042
1051 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { 1043 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
1052 if (host_impl->active_tree()->source_frame_number() >= 2) 1044 if (host_impl->active_tree()->source_frame_number() >= 2)
1053 EndTest(); 1045 EndTest();
1054 } 1046 }
1055 1047
1056 void AfterTest() override {} 1048 void AfterTest() override {}
1057 }; 1049 };
1058 1050
1059 MULTI_THREAD_TEST_F( 1051 MULTI_THREAD_TEST_F(
1060 MAYBE_LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction); 1052 LayerTreeHostTimelinesTestSetPotentiallyAnimatingOnLacDestruction);
1061 1053
1062 // Check that we invalidate property trees on AnimationPlayer::SetNeedsCommit. 1054 // Check that we invalidate property trees on AnimationPlayer::SetNeedsCommit.
1063 class LayerTreeHostTimelinesTestRebuildPropertyTreesOnAnimationSetNeedsCommit 1055 class LayerTreeHostTimelinesTestRebuildPropertyTreesOnAnimationSetNeedsCommit
1064 : public LayerTreeHostTimelinesTest { 1056 : public LayerTreeHostTimelinesTest {
1065 public: 1057 public:
1066 void SetupTree() override { 1058 void SetupTree() override {
1067 LayerTreeHostTimelinesTest::SetupTree(); 1059 LayerTreeHostTimelinesTest::SetupTree();
1068 layer_ = FakePictureLayer::Create(layer_settings(), &client_); 1060 layer_ = FakePictureLayer::Create(layer_settings(), &client_);
1069 layer_->SetBounds(gfx::Size(4, 4)); 1061 layer_->SetBounds(gfx::Size(4, 4));
1070 layer_tree_host()->root_layer()->AddChild(layer_); 1062 layer_tree_host()->root_layer()->AddChild(layer_);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 private: 1094 private:
1103 scoped_refptr<Layer> layer_; 1095 scoped_refptr<Layer> layer_;
1104 FakeContentLayerClient client_; 1096 FakeContentLayerClient client_;
1105 }; 1097 };
1106 1098
1107 MULTI_THREAD_TEST_F( 1099 MULTI_THREAD_TEST_F(
1108 LayerTreeHostTimelinesTestRebuildPropertyTreesOnAnimationSetNeedsCommit); 1100 LayerTreeHostTimelinesTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
1109 1101
1110 } // namespace 1102 } // namespace
1111 } // namespace cc 1103 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698