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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2715243008: 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
« no previous file with comments | « cc/trees/draw_property_utils.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 97dc00ead7867d78671dfff3b4816424851b6b09..4cf4ab12552a2d4814deb027e4f484c3b4d1a7a9 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -10137,6 +10137,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 =
@@ -10145,13 +10148,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) {
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698