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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2712053002: cc : Fix transform calculation bug while calculating clip rects (Closed)
Patch Set: Created 3 years, 10 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
« cc/trees/draw_property_utils.cc ('K') | « 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 969398354c27a08fbe0a5efc614eac2302d1ede4..b443c2ca89a3b230a50ae556e200d63c5a1d773b 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -10131,6 +10131,9 @@ TEST_F(LayerTreeHostCommonTest, ClipParentDrawsIntoScaledRootSurface) {
unclipped_desc_surface->test_properties()->force_render_surface = true;
clip_child->SetBounds(gfx::Size(100, 100));
clip_child->SetDrawsContent(true);
+ gfx::Transform translate;
+ translate.Translate(10, 10);
+ unclipped_desc_surface->test_properties()->transform = translate;
clip_child->test_properties()->clip_parent = clip_parent;
clip_parent->test_properties()->clip_children =
@@ -10139,13 +10142,13 @@ TEST_F(LayerTreeHostCommonTest, ClipParentDrawsIntoScaledRootSurface) {
float device_scale_factor = 1.f;
ExecuteCalculateDrawProperties(root, device_scale_factor);
- EXPECT_EQ(gfx::Rect(20, 20), clip_child->clip_rect());
- EXPECT_EQ(gfx::Rect(20, 20), clip_child->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(-10, -10, 20, 20), clip_child->clip_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), clip_child->visible_layer_rect());
device_scale_factor = 2.f;
ExecuteCalculateDrawProperties(root, device_scale_factor);
- EXPECT_EQ(gfx::Rect(40, 40), clip_child->clip_rect());
- EXPECT_EQ(gfx::Rect(20, 20), clip_child->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(-20, -20, 40, 40), clip_child->clip_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), clip_child->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest, ClipChildVisibleRect) {
« cc/trees/draw_property_utils.cc ('K') | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698