| 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 3695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3706 child->AddChild(std::move(grand_child)); | 3706 child->AddChild(std::move(grand_child)); |
| 3707 root->AddChild(std::move(child)); | 3707 root->AddChild(std::move(child)); |
| 3708 root->AddChild(std::move(occluding_child)); | 3708 root->AddChild(std::move(occluding_child)); |
| 3709 host_impl.active_tree()->SetRootLayer(std::move(root)); | 3709 host_impl.active_tree()->SetRootLayer(std::move(root)); |
| 3710 host_impl.SetVisible(true); | 3710 host_impl.SetVisible(true); |
| 3711 host_impl.InitializeRenderer(output_surface.get()); | 3711 host_impl.InitializeRenderer(output_surface.get()); |
| 3712 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 3712 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 3713 bool update_lcd_text = false; | 3713 bool update_lcd_text = false; |
| 3714 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); | 3714 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); |
| 3715 | 3715 |
| 3716 LayerImpl* grand_child_ptr = | 3716 LayerImpl* grand_child_ptr = host_impl.active_tree() |
| 3717 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; | 3717 ->root_layer() |
| 3718 ->test_properties() |
| 3719 ->children[0] |
| 3720 ->test_properties() |
| 3721 ->children[0]; |
| 3718 | 3722 |
| 3719 // Though all layers have invertible transforms, matrix multiplication using | 3723 // Though all layers have invertible transforms, matrix multiplication using |
| 3720 // floating-point math makes the draw transform uninvertible. | 3724 // floating-point math makes the draw transform uninvertible. |
| 3721 EXPECT_FALSE( | 3725 EXPECT_FALSE( |
| 3722 host_impl.active_tree() | 3726 host_impl.active_tree() |
| 3723 ->property_trees() | 3727 ->property_trees() |
| 3724 ->transform_tree.Node(grand_child_ptr->transform_tree_index()) | 3728 ->transform_tree.Node(grand_child_ptr->transform_tree_index()) |
| 3725 ->data.ancestors_are_invertible); | 3729 ->data.ancestors_are_invertible); |
| 3726 | 3730 |
| 3727 // Since |grand_child| has an uninvertible screen space transform, it is | 3731 // Since |grand_child| has an uninvertible screen space transform, it is |
| (...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8052 gfx::Point3F(), | 8056 gfx::Point3F(), |
| 8053 gfx::PointF(), | 8057 gfx::PointF(), |
| 8054 root_size, | 8058 root_size, |
| 8055 false, | 8059 false, |
| 8056 false, | 8060 false, |
| 8057 true); | 8061 true); |
| 8058 root->SetMasksToBounds(true); | 8062 root->SetMasksToBounds(true); |
| 8059 | 8063 |
| 8060 root->AddChild(LayerImpl::Create(host_impl.active_tree(), 2)); | 8064 root->AddChild(LayerImpl::Create(host_impl.active_tree(), 2)); |
| 8061 | 8065 |
| 8062 LayerImpl* sublayer = root->child_at(0); | 8066 LayerImpl* sublayer = root->test_properties()->children[0]; |
| 8063 SetLayerPropertiesForTesting(sublayer, | 8067 SetLayerPropertiesForTesting(sublayer, |
| 8064 identity_matrix, | 8068 identity_matrix, |
| 8065 gfx::Point3F(), | 8069 gfx::Point3F(), |
| 8066 gfx::PointF(), | 8070 gfx::PointF(), |
| 8067 sublayer_size, | 8071 sublayer_size, |
| 8068 false, | 8072 false, |
| 8069 false, | 8073 false, |
| 8070 false); | 8074 false); |
| 8071 sublayer->SetDrawsContent(true); | 8075 sublayer->SetDrawsContent(true); |
| 8072 | 8076 |
| (...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10276 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10280 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 10277 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10281 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 10278 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10282 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 10279 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10283 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 10280 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10284 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 10281 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10285 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 10282 } | 10286 } |
| 10283 | 10287 |
| 10284 } // namespace | 10288 } // namespace |
| 10285 } // namespace cc | 10289 } // namespace cc |
| OLD | NEW |