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

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

Issue 1850493002: cc : Remove parent for mask and replica layers in LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete dead code 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 SetLayerPropertiesForTesting(grand_child_of_rs2, layer_transform, 813 SetLayerPropertiesForTesting(grand_child_of_rs2, layer_transform,
814 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(), 814 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(),
815 gfx::Size(10, 10), true, false, false); 815 gfx::Size(10, 10), true, false, false);
816 SetLayerPropertiesForTesting(replica_of_rs1.get(), replica_layer_transform, 816 SetLayerPropertiesForTesting(replica_of_rs1.get(), replica_layer_transform,
817 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(), 817 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(),
818 gfx::Size(), true, false, false); 818 gfx::Size(), true, false, false);
819 SetLayerPropertiesForTesting(replica_of_rs2.get(), replica_layer_transform, 819 SetLayerPropertiesForTesting(replica_of_rs2.get(), replica_layer_transform,
820 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(), 820 gfx::Point3F(2.5f, 0.f, 0.f), gfx::PointF(),
821 gfx::Size(), true, false, false); 821 gfx::Size(), true, false, false);
822 822
823 replica_of_rs1->SetParent(render_surface1);
824 replica_of_rs2->SetParent(render_surface2);
823 render_surface1->SetReplicaLayer(std::move(replica_of_rs1)); 825 render_surface1->SetReplicaLayer(std::move(replica_of_rs1));
824 render_surface2->SetReplicaLayer(std::move(replica_of_rs2)); 826 render_surface2->SetReplicaLayer(std::move(replica_of_rs2));
825 ExecuteCalculateDrawProperties(root); 827 ExecuteCalculateDrawProperties(root);
826 828
827 // Only layers that are associated with render surfaces should have an actual 829 // Only layers that are associated with render surfaces should have an actual
828 // RenderSurface() value. 830 // RenderSurface() value.
829 ASSERT_TRUE(root->render_surface()); 831 ASSERT_TRUE(root->render_surface());
830 ASSERT_FALSE(child_of_root->render_surface()); 832 ASSERT_FALSE(child_of_root->render_surface());
831 ASSERT_FALSE(grand_child_of_root->render_surface()); 833 ASSERT_FALSE(grand_child_of_root->render_surface());
832 834
(...skipping 4101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4934 true, true); 4936 true, true);
4935 4937
4936 gfx::Transform replica_transform; 4938 gfx::Transform replica_transform;
4937 replica_transform.Scale(1.0, -1.0); 4939 replica_transform.Scale(1.0, -1.0);
4938 4940
4939 scoped_ptr<LayerImpl> replica = 4941 scoped_ptr<LayerImpl> replica =
4940 LayerImpl::Create(host_impl()->active_tree(), 7); 4942 LayerImpl::Create(host_impl()->active_tree(), 7);
4941 SetLayerPropertiesForTesting(replica.get(), replica_transform, gfx::Point3F(), 4943 SetLayerPropertiesForTesting(replica.get(), replica_transform, gfx::Point3F(),
4942 gfx::PointF(2.f, 2.f), gfx::Size(10, 10), false, 4944 gfx::PointF(2.f, 2.f), gfx::Size(10, 10), false,
4943 true, false); 4945 true, false);
4946 replica->SetParent(child);
4944 child->SetReplicaLayer(std::move(replica)); 4947 child->SetReplicaLayer(std::move(replica));
4945 4948
4946 // This layer should end up in the same surface as child, with the same draw 4949 // This layer should end up in the same surface as child, with the same draw
4947 // and screen space transforms. 4950 // and screen space transforms.
4948 LayerImpl* duplicate_child_non_owner = AddChild<LayerImpl>(child); 4951 LayerImpl* duplicate_child_non_owner = AddChild<LayerImpl>(child);
4949 duplicate_child_non_owner->SetDrawsContent(true); 4952 duplicate_child_non_owner->SetDrawsContent(true);
4950 SetLayerPropertiesForTesting(duplicate_child_non_owner, identity_matrix, 4953 SetLayerPropertiesForTesting(duplicate_child_non_owner, identity_matrix,
4951 gfx::Point3F(), gfx::PointF(), gfx::Size(10, 10), 4954 gfx::Point3F(), gfx::PointF(), gfx::Size(10, 10),
4952 false, true, false); 4955 false, true, false);
4953 4956
(...skipping 4930 matching lines...) Expand 10 before | Expand all | Expand 10 after
9884 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 9887 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
9885 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 9888 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
9886 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 9889 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
9887 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 9890 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
9888 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 9891 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
9889 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 9892 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
9890 } 9893 }
9891 9894
9892 } // namespace 9895 } // namespace
9893 } // namespace cc 9896 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698