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 10052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10063 // We want layer between the two targets to create a clip node and transform | 10063 // We want layer between the two targets to create a clip node and transform |
10064 // node but it shouldn't create a render surface. | 10064 // node but it shouldn't create a render surface. |
10065 between_targets->SetMasksToBounds(true); | 10065 between_targets->SetMasksToBounds(true); |
10066 between_targets->Set3dSortingContextId(2); | 10066 between_targets->Set3dSortingContextId(2); |
10067 | 10067 |
10068 ExecuteCalculateDrawProperties(root); | 10068 ExecuteCalculateDrawProperties(root); |
10069 | 10069 |
10070 TransformTree& tree = | 10070 TransformTree& tree = |
10071 root->layer_tree_impl()->property_trees()->transform_tree; | 10071 root->layer_tree_impl()->property_trees()->transform_tree; |
10072 TransformNode* node = tree.Node(render_surface1->transform_tree_index()); | 10072 TransformNode* node = tree.Node(render_surface1->transform_tree_index()); |
10073 EXPECT_EQ(node->sublayer_scale, gfx::Vector2dF(2.f, 2.f)); | 10073 EXPECT_EQ(node->surface_contents_scale, gfx::Vector2dF(2.f, 2.f)); |
10074 | 10074 |
10075 node = tree.Node(between_targets->transform_tree_index()); | 10075 node = tree.Node(between_targets->transform_tree_index()); |
10076 EXPECT_EQ(node->sublayer_scale, gfx::Vector2dF(1.f, 1.f)); | 10076 EXPECT_EQ(node->surface_contents_scale, gfx::Vector2dF(1.f, 1.f)); |
10077 | 10077 |
10078 node = tree.Node(render_surface2->transform_tree_index()); | 10078 node = tree.Node(render_surface2->transform_tree_index()); |
10079 EXPECT_EQ(node->sublayer_scale, gfx::Vector2dF(2.f, 2.f)); | 10079 EXPECT_EQ(node->surface_contents_scale, gfx::Vector2dF(2.f, 2.f)); |
10080 | 10080 |
10081 EXPECT_EQ(gfx::Rect(15, 15), test_layer->visible_layer_rect()); | 10081 EXPECT_EQ(gfx::Rect(15, 15), test_layer->visible_layer_rect()); |
10082 } | 10082 } |
10083 | 10083 |
10084 TEST_F(LayerTreeHostCommonTest, LargeTransformTest) { | 10084 TEST_F(LayerTreeHostCommonTest, LargeTransformTest) { |
10085 LayerImpl* root = root_layer_for_testing(); | 10085 LayerImpl* root = root_layer_for_testing(); |
10086 LayerImpl* render_surface1 = AddChild<LayerImpl>(root); | 10086 LayerImpl* render_surface1 = AddChild<LayerImpl>(root); |
10087 LayerImpl* child = AddChild<LayerImpl>(render_surface1); | 10087 LayerImpl* child = AddChild<LayerImpl>(render_surface1); |
10088 | 10088 |
10089 const gfx::Transform identity_matrix; | 10089 const gfx::Transform identity_matrix; |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10521 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10521 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
10522 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10522 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
10523 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10523 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
10524 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10524 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
10525 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10525 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
10526 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10526 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
10527 } | 10527 } |
10528 | 10528 |
10529 } // namespace | 10529 } // namespace |
10530 } // namespace cc | 10530 } // namespace cc |
OLD | NEW |