From 6394d5b43b6327ff5ebcd17a41ad0919a390a406 Mon Sep 17 00:00:00 2001 From: enne Date: Tue, 26 May 2015 15:23:11 -0700 Subject: cc: Apply page scale to page scale layer Currently, page scale is applied to children of the page scale layer but not to the page scale layer itself. This makes it cumbersome to update property trees during pinch zoom on the compositor thread, because the property tree needs to be searched for any nodes that use the page scale layer's node as a source node. In practice, from Blink, the page scale layer only has one child, but it's a layering violation to assume this. So, apply page scale to the target transform for the page scale layer itself. This shouldn't have any effect in practice, as the page scale layer doesn't usually have content. Also, clean up language that refers to both "page scale layer" and "page scale application layer". In CDP, these are the same thing, but in property tree land one is the parent and one is the child. Now there is only "page scale layer", which gets the page scale applied on it and to its children. This passes cc unit tests with main thread property tree verification manually hacked back on. R=ajuma@chromium.org, vollick@chromium.org, jdduke@chromium.org BUG=481585 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1144103003 Cr-Commit-Position: refs/heads/master@{#331451} --- cc/trees/layer_tree_impl_unittest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cc/trees/layer_tree_impl_unittest.cc') diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 04c108f..11ce4bc 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -2127,11 +2127,11 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForScaledLayers) { host_impl().active_tree()->GetViewportSelection(&output); EXPECT_EQ(input.start.type, output.start.type); gfx::PointF expected_output_start_top = input.start.edge_top; - gfx::PointF expected_output_edge_botom = input.start.edge_bottom; + gfx::PointF expected_output_edge_bottom = input.start.edge_bottom; expected_output_start_top.Scale(page_scale_factor); - expected_output_edge_botom.Scale(page_scale_factor); - EXPECT_EQ(input.start.edge_top, output.start.edge_top); - EXPECT_EQ(input.start.edge_bottom, output.start.edge_bottom); + expected_output_edge_bottom.Scale(page_scale_factor); + EXPECT_EQ(expected_output_start_top, output.start.edge_top); + EXPECT_EQ(expected_output_edge_bottom, output.start.edge_bottom); EXPECT_TRUE(output.start.visible); EXPECT_EQ(input.end.type, output.end.type); -- cgit v1.1