OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1117 grand_child->SetDrawsContent(true); | 1117 grand_child->SetDrawsContent(true); |
1118 float device_scale_factor = 1.f; | 1118 float device_scale_factor = 1.f; |
1119 float page_scale_factor = 1.f; | 1119 float page_scale_factor = 1.f; |
1120 LayerImpl* page_scale_layer = nullptr; | 1120 LayerImpl* page_scale_layer = nullptr; |
1121 LayerImpl* inner_viewport_scroll_layer = nullptr; | 1121 LayerImpl* inner_viewport_scroll_layer = nullptr; |
1122 LayerImpl* outer_viewport_scroll_layer = nullptr; | 1122 LayerImpl* outer_viewport_scroll_layer = nullptr; |
1123 ExecuteCalculateDrawProperties(root, device_scale_factor, page_scale_factor, | 1123 ExecuteCalculateDrawProperties(root, device_scale_factor, page_scale_factor, |
1124 page_scale_layer, inner_viewport_scroll_layer, | 1124 page_scale_layer, inner_viewport_scroll_layer, |
1125 outer_viewport_scroll_layer); | 1125 outer_viewport_scroll_layer); |
1126 | 1126 |
1127 // Mapping grand_child's bounds to screen space produces an empty rect so | 1127 // Mapping grand_child's bounds to screen space produces an empty rect, but |
1128 // grand_child should be hidden. | 1128 // only because it is turned sideways. The entire rect is contained inside |
1129 EXPECT_EQ(gfx::Rect(), grand_child->visible_layer_rect()); | 1129 // the clip, and is only empty so land as the numerical precision of the |
Peter Mayo
2017/03/28 20:15:40
s/land/long/
Done.
| |
1130 // transform is effectively perfect. Currently we do the calculation the | |
1131 // way around, and the Projection of the screen space clip into layer space | |
jaydasika
2017/03/28 20:11:48
nit : the 'other' way around ?
Peter Mayo
2017/03/28 20:15:40
Done.
| |
1132 // includes the entire bounds. | |
1133 EXPECT_EQ(gfx::Rect(grand_child->bounds()), | |
1134 grand_child->visible_layer_rect()); | |
1130 } | 1135 } |
1131 | 1136 |
1132 TEST_F(LayerTreeHostCommonTest, TransformsForDegenerateIntermediateLayer) { | 1137 TEST_F(LayerTreeHostCommonTest, TransformsForDegenerateIntermediateLayer) { |
1133 // A layer that is empty in one axis, but not the other, was accidentally | 1138 // A layer that is empty in one axis, but not the other, was accidentally |
1134 // skipping a necessary translation. Without that translation, the coordinate | 1139 // skipping a necessary translation. Without that translation, the coordinate |
1135 // space of the layer's draw transform is incorrect. | 1140 // space of the layer's draw transform is incorrect. |
1136 // | 1141 // |
1137 // Normally this isn't a problem, because the layer wouldn't be drawn anyway, | 1142 // Normally this isn't a problem, because the layer wouldn't be drawn anyway, |
1138 // but if that layer becomes a render surface, then its draw transform is | 1143 // but if that layer becomes a render surface, then its draw transform is |
1139 // implicitly inherited by the rest of the subtree, which then is positioned | 1144 // implicitly inherited by the rest of the subtree, which then is positioned |
(...skipping 9587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10727 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10732 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
10728 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10733 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
10729 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10734 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
10730 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10735 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
10731 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10736 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
10732 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10737 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
10733 } | 10738 } |
10734 | 10739 |
10735 } // namespace | 10740 } // namespace |
10736 } // namespace cc | 10741 } // namespace cc |
OLD | NEW |