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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1643053002: cc :: Fix sublayer scale bug when we have scroll parents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 3a426ec92fa14142e90828bedacea6ae7db0f5e3..b712255eb111f9b9c43dbca390b57a6a6ab20071 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -6564,10 +6564,23 @@ TEST_F(LayerTreeHostCommonTest, ScrollChildAndScrollParentDifferentTargets) {
gfx::Size(50, 50), true, false, true);
SetLayerPropertiesForTesting(scroll_parent, identity_transform,
gfx::Point3F(), gfx::PointF(), gfx::Size(50, 50),
- true, false, true);
+ true, false, false);
+ scroll_parent_target->SetMasksToBounds(true);
- ExecuteCalculateDrawProperties(root);
- EXPECT_EQ(scroll_child->DrawTransform(), identity_transform);
+ float device_scale_factor = 1.5f;
+ LayerImplList render_surface_layer_list_impl;
+ root->layer_tree_impl()->IncrementRenderSurfaceListIdForTesting();
+ LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
+ root, root->bounds(), identity_transform, &render_surface_layer_list_impl,
+ root->layer_tree_impl()->current_render_surface_list_id());
+ inputs.device_scale_factor = device_scale_factor;
+ LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+
+ EXPECT_EQ(scroll_child->visible_layer_rect(), gfx::Rect(10, 10, 40, 40));
+ EXPECT_EQ(scroll_child->clip_rect(), gfx::Rect(15, 15, 75, 75));
+ gfx::Transform scale;
+ scale.Scale(1.5f, 1.5f);
+ EXPECT_EQ(scroll_child->DrawTransform(), scale);
}
TEST_F(LayerTreeHostCommonTest, SingularTransformSubtreesDoNotDraw) {
« 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