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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1884613005: cc : Simplify layer skipping logic (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_common.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 87f37edfa218229a068c058d26826807e41e8e45..c819f2d560a8518690b0ef8c01d599f350b65b0d 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1338,11 +1338,12 @@ TEST_F(LayerTreeHostCommonTest,
EffectTree& effect_tree =
parent->layer_tree_impl()->property_trees()->effect_tree;
EffectNode* node = effect_tree.Node(render_surface1->effect_tree_index());
- EXPECT_TRUE(node->data.is_drawn);
+ EXPECT_TRUE(node->data.is_drawn_on_active);
// When parent is transparent, the layer should not be drawn.
parent->OnOpacityAnimated(0.f);
render_surface1->OnOpacityAnimated(1.f);
+ render_surface1->set_visible_layer_rect(gfx::Rect());
{
LayerImplList render_surface_layer_list;
parent->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting();
@@ -1354,7 +1355,8 @@ TEST_F(LayerTreeHostCommonTest,
}
node = effect_tree.Node(render_surface1->effect_tree_index());
- EXPECT_FALSE(node->data.is_drawn);
+ EXPECT_FALSE(node->data.is_drawn_on_active);
+ EXPECT_EQ(gfx::Rect(), render_surface1->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForFilter) {
@@ -5189,7 +5191,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
EffectTree tree =
root_layer->layer_tree_impl()->property_trees()->effect_tree;
EffectNode* node = tree.Node(child_ptr->effect_tree_index());
- EXPECT_FALSE(node->data.is_drawn);
+ EXPECT_FALSE(node->data.is_drawn_on_active);
jaydasika 2016/04/13 00:17:52 This should be the main and pending bool.
// A layer should be drawn and it should contribute to drawn surface when
// it has animating opacity even if it has opacity 0.
@@ -5207,7 +5209,7 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
child_ptr = root_layer->layer_tree_impl()->LayerById(2);
tree = root_layer->layer_tree_impl()->property_trees()->effect_tree;
node = tree.Node(child_ptr->effect_tree_index());
- EXPECT_TRUE(node->data.is_drawn);
+ EXPECT_TRUE(node->data.is_drawn_on_main_and_pending);
EXPECT_TRUE(tree.ContributesToDrawnSurface(child_ptr->effect_tree_index()));
}
@@ -5659,28 +5661,20 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
EXPECT_GT(copy_parent_layer->num_copy_requests_in_target_subtree(), 0);
EXPECT_GT(copy_layer->num_copy_requests_in_target_subtree(), 0);
- // We should have four render surfaces, one for the root, one for the grand
- // parent since it has opacity and two drawing descendants, one for the parent
- // since it owns a surface, and one for the copy_layer.
- ASSERT_EQ(4u, render_surface_layer_list.size());
+ // We should have two render surfaces, one for the root and one for the
+ // copy_layer.
+ ASSERT_EQ(2u, render_surface_layer_list.size());
EXPECT_EQ(root_layer->id(), render_surface_layer_list.at(0)->id());
- EXPECT_EQ(copy_grand_parent_layer->id(),
- render_surface_layer_list.at(1)->id());
- EXPECT_EQ(copy_parent_layer->id(), render_surface_layer_list.at(2)->id());
- EXPECT_EQ(copy_layer->id(), render_surface_layer_list.at(3)->id());
+ EXPECT_EQ(copy_layer->id(), render_surface_layer_list.at(1)->id());
// The root render surface should have 2 contributing layers.
ASSERT_EQ(2u, root_layer->render_surface()->layer_list().size());
EXPECT_EQ(root_layer->id(),
root_layer->render_surface()->layer_list().at(0)->id());
- EXPECT_EQ(copy_grand_parent_layer->id(),
+ EXPECT_EQ(copy_layer->id(),
root_layer->render_surface()->layer_list().at(1)->id());
- // Nothing actually draws into the copy parent, so only the copy_layer will
- // appear in its list, since it needs to be drawn for the copy request.
- ASSERT_EQ(1u, copy_parent_layer->render_surface()->layer_list().size());
- EXPECT_EQ(copy_layer->id(),
- copy_layer->render_surface()->layer_list().at(0)->id());
+ ASSERT_EQ(0u, copy_parent_layer->render_surface()->layer_list().size());
// The copy_layer's render surface should have two contributing layers.
ASSERT_EQ(2u, copy_layer->render_surface()->layer_list().size());
@@ -5696,15 +5690,15 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
EffectTree tree =
root_layer->layer_tree_impl()->property_trees()->effect_tree;
EffectNode* node = tree.Node(copy_grand_parent_layer->effect_tree_index());
- EXPECT_FALSE(node->data.is_drawn);
+ EXPECT_FALSE(node->data.is_drawn_on_active);
node = tree.Node(copy_parent_layer->effect_tree_index());
- EXPECT_FALSE(node->data.is_drawn);
+ EXPECT_FALSE(node->data.is_drawn_on_active);
node = tree.Node(copy_layer->effect_tree_index());
- EXPECT_TRUE(node->data.is_drawn);
+ EXPECT_TRUE(node->data.is_drawn_on_active);
node = tree.Node(copy_child_layer->effect_tree_index());
- EXPECT_TRUE(node->data.is_drawn);
+ EXPECT_TRUE(node->data.is_drawn_on_active);
node = tree.Node(copy_grand_child_layer->effect_tree_index());
- EXPECT_FALSE(node->data.is_drawn);
+ EXPECT_FALSE(node->data.is_drawn_on_active);
// Though copy_layer is drawn, it shouldn't contribute to drawn surface as its
// actually hidden.
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698