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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2305873002: cc: Include viewport clip in visible rect of unclipped surfaces (Closed)
Patch Set: comment Created 4 years, 3 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/draw_property_utils.cc ('k') | no next file » | 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 9ee12f9c0a21e90c5001c0d63015d0b81c7ad10c..a4b4caafe2f5ad0c98145b1863b7e87ba50a8746 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -3337,21 +3337,20 @@ TEST_F(LayerTreeHostCommonTest,
parent->SetMasksToBounds(false);
// Case 3: child1 and grand_child2 clip. In this case, descendants of these
- // layers have their visible rects clipped by them; without surfaces, these
- // rects are also clipped by the viewport. Similarly, descendants of these
- // layers have their drawable content rects clipped by them.
+ // layers have their visible rects clipped by them; Similarly, descendants of
+ // these layers have their drawable content rects clipped by them.
child1->SetMasksToBounds(true);
grand_child2->SetMasksToBounds(true);
host_impl()->active_tree()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(root);
EXPECT_EQ(gfx::Rect(100, 100), root->visible_layer_rect());
EXPECT_EQ(gfx::Rect(98, 98), parent->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(800, 800), child1->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(94, 94), child1->visible_layer_rect());
EXPECT_EQ(gfx::Rect(800, 800), child2->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(792, 792), grand_child1->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(1500, 1500), grand_child2->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(776, 776), leaf_node1->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(1491, 1491), leaf_node2->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(86, 86), grand_child1->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(88, 88), grand_child2->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(70, 70), leaf_node1->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(79, 79), leaf_node2->visible_layer_rect());
EXPECT_EQ(gfx::Rect(100, 100), root->drawable_content_rect());
EXPECT_EQ(gfx::Rect(2, 2, 400, 400), parent->drawable_content_rect());
@@ -3793,7 +3792,7 @@ TEST_F(LayerTreeHostCommonTest,
child1->SetMasksToBounds(true);
child2->SetMasksToBounds(true);
ExecuteCalculateDrawProperties(root);
- EXPECT_EQ(gfx::Rect(500, 500), child1->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(100, 100), child1->visible_layer_rect());
EXPECT_EQ(gfx::Rect(100, 100), render_surface2->visible_layer_rect());
}
@@ -3966,7 +3965,7 @@ TEST_F(LayerTreeHostCommonTest, RootClipPropagationToClippedSurface) {
ExecuteCalculateDrawProperties(root);
EXPECT_EQ(gfx::Rect(50, 50), unclipped_surface->visible_layer_rect());
- EXPECT_EQ(gfx::Rect(50, 50), unclipped_desc_surface->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), unclipped_desc_surface->visible_layer_rect());
EXPECT_EQ(gfx::Rect(10, 10), clipped_surface->visible_layer_rect());
}
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698