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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1912893002: cc : Stop pushing properties not used by LayerImpl to LayerImpl. (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_filters.cc ('k') | cc/trees/layer_tree_host_unittest_copyrequest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index a6facc6b8484cdc072c06e7cbd0156b81c0ac8c5..1db4de9ac77535f11a02c4318dfe7bc58ef84dc6 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -688,6 +688,53 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesTo);
+class LayerTreeHostTestDamageWithReplica : public LayerTreeHostTest {
+ protected:
+ void SetupTree() override {
+ scoped_refptr<Layer> root = Layer::Create();
+ layer_tree_host()->SetRootLayer(root);
+ LayerTreeHostTest::SetupTree();
+ }
+
+ void BeginTest() override {
+ index_ = 0;
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void DidCommit() override {
+ switch (layer_tree_host()->source_frame_number()) {
+ case 0:
+ break;
+ case 1:
+ scoped_refptr<Layer> replica_layer = Layer::Create();
+ layer_tree_host()->root_layer()->SetReplicaLayer(replica_layer.get());
+ break;
+ }
+ }
+
+ void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
+ switch (index_) {
+ case 0:
+ impl->sync_tree()->ResetAllChangeTracking(
+ PropertyTrees::ResetFlags::ALL_TREES);
+ EXPECT_FALSE(impl->sync_tree()->root_layer()->LayerPropertyChanged());
+ PostSetNeedsCommitToMainThread();
+ index_++;
+ break;
+ case 1:
+ EXPECT_TRUE(impl->sync_tree()->root_layer()->LayerPropertyChanged());
+ EndTest();
+ break;
+ }
+ }
+
+ void AfterTest() override {}
+
+ int index_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithReplica);
+
// Verify damage status of property trees is preserved after commit.
class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
protected:
@@ -695,7 +742,7 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<Layer> child = Layer::Create();
// This is to force the child to create a transform and effect node.
- child->SetForceRenderSurface(true);
+ child->SetForceRenderSurfaceForTesting(true);
root->AddChild(std::move(child));
layer_tree_host()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
@@ -1358,7 +1405,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
case 3:
// Test owning the surface.
parent_layer_->SetOpacity(0.5f);
- parent_layer_->SetForceRenderSurface(true);
+ parent_layer_->SetForceRenderSurfaceForTesting(true);
break;
case 4:
EndTest();
@@ -2344,7 +2391,7 @@ class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest {
parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetIsDrawable(true);
parent_layer_->SetBounds(gfx::Size(50, 50));
- parent_layer_->SetForceRenderSurface(true);
+ parent_layer_->SetForceRenderSurfaceForTesting(true);
child_layer_ = FakePictureLayer::Create(&client_);
child_layer_->SetIsDrawable(true);
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_filters.cc ('k') | cc/trees/layer_tree_host_unittest_copyrequest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698