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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: rebase Created 3 years, 9 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_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('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 78de99b73c25e47350e6d2bc96edcad86512fa9e..176f7baec707f3f1955cef2cf3849956102a253f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -804,7 +804,7 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
void DidCommit() override {
switch (layer_tree_host()->SourceFrameNumber()) {
case 1:
- // child_ should create transform, effect, clip node.
+ // child_ should create transform, effect node.
child_->SetForceRenderSurfaceForTesting(true);
break;
case 2:
@@ -812,7 +812,12 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
child_->SetScrollClipLayerId(root_->id());
break;
case 3:
+ // child_ should create a clip node.
+ child_->SetMasksToBounds(true);
+ break;
+ case 4:
// child_ should not create any property tree node.
+ child_->SetMasksToBounds(false);
child_->SetForceRenderSurfaceForTesting(false);
child_->SetScrollClipLayerId(Layer::INVALID_ID);
}
@@ -838,30 +843,28 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
property_trees->scroll_tree.FindNodeFromOwningLayerId(child_->id());
switch (impl->sync_tree()->source_frame_number()) {
case 0:
- // root_ should create every property tree node and child_ should not
- // create any.
+ // root_ should create transform, scroll and effect tree nodes but not
+ // a clip node.
EXPECT_NE(root_transform_node, nullptr);
EXPECT_EQ(root_transform_node->id, root_->transform_tree_index());
EXPECT_NE(root_effect_node, nullptr);
EXPECT_EQ(root_effect_node->id, root_->effect_tree_index());
- EXPECT_NE(root_clip_node, nullptr);
- EXPECT_EQ(root_clip_node->id, root_->clip_tree_index());
EXPECT_NE(root_scroll_node, nullptr);
EXPECT_EQ(root_scroll_node->id, root_->scroll_tree_index());
+ EXPECT_EQ(root_clip_node, nullptr);
EXPECT_EQ(child_transform_node, nullptr);
EXPECT_EQ(child_effect_node, nullptr);
EXPECT_EQ(child_clip_node, nullptr);
EXPECT_EQ(child_scroll_node, nullptr);
break;
case 1:
- // child_ should create a transfrom, clip, effect nodes but not a scroll
+ // child_ should create a transfrom, effect nodes but not a scroll, clip
// node.
EXPECT_NE(child_transform_node, nullptr);
EXPECT_EQ(child_transform_node->id, child_->transform_tree_index());
EXPECT_NE(child_effect_node, nullptr);
EXPECT_EQ(child_effect_node->id, child_->effect_tree_index());
- EXPECT_NE(child_clip_node, nullptr);
- EXPECT_EQ(child_clip_node->id, child_->clip_tree_index());
+ EXPECT_EQ(child_clip_node, nullptr);
EXPECT_EQ(child_scroll_node, nullptr);
break;
case 2:
@@ -870,6 +873,11 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
EXPECT_EQ(child_scroll_node->id, child_->scroll_tree_index());
break;
case 3:
+ // child_ should create a clip node.
+ EXPECT_NE(child_clip_node, nullptr);
+ EXPECT_EQ(child_clip_node->id, child_->clip_tree_index());
+ break;
+ case 4:
// child_ should not create any property tree nodes.
EXPECT_EQ(child_transform_node, nullptr);
EXPECT_EQ(child_effect_node, nullptr);
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698