OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "cc/layers/heads_up_display_layer_impl.h" | 7 #include "cc/layers/heads_up_display_layer_impl.h" |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 position = gfx::PointF(); | 965 position = gfx::PointF(); |
966 bounds = gfx::Size(200, 200); | 966 bounds = gfx::Size(200, 200); |
967 SetLayerPropertiesForTesting(scroll_child.get(), identity_matrix, | 967 SetLayerPropertiesForTesting(scroll_child.get(), identity_matrix, |
968 transform_origin, position, bounds, true, | 968 transform_origin, position, bounds, true, |
969 false, false); | 969 false, false); |
970 scroll_child->SetDrawsContent(true); | 970 scroll_child->SetDrawsContent(true); |
971 | 971 |
972 // This should cause scroll child and its descendants to be affected by | 972 // This should cause scroll child and its descendants to be affected by |
973 // |child|'s clip. | 973 // |child|'s clip. |
974 scroll_child->SetScrollParent(child.get()); | 974 scroll_child->SetScrollParent(child.get()); |
| 975 scoped_ptr<std::set<LayerImpl*>> scroll_children(new std::set<LayerImpl*>); |
| 976 scroll_children->insert(scroll_child.get()); |
| 977 child->SetScrollChildren(scroll_children.release()); |
975 | 978 |
976 SetLayerPropertiesForTesting(grand_child.get(), identity_matrix, | 979 SetLayerPropertiesForTesting(grand_child.get(), identity_matrix, |
977 transform_origin, position, bounds, true, | 980 transform_origin, position, bounds, true, |
978 false, false); | 981 false, false); |
979 grand_child->SetDrawsContent(true); | 982 grand_child->SetDrawsContent(true); |
980 grand_child->SetHasRenderSurface(true); | 983 grand_child->SetHasRenderSurface(true); |
981 | 984 |
982 scroll_child->AddChild(grand_child.Pass()); | 985 scroll_child->AddChild(grand_child.Pass()); |
983 root->AddChild(scroll_child.Pass()); | 986 root->AddChild(scroll_child.Pass()); |
984 root->AddChild(child.Pass()); | 987 root->AddChild(child.Pass()); |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1970 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); | 1973 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); |
1971 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); | 1974 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); |
1972 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); | 1975 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); |
1973 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); | 1976 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); |
1974 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); | 1977 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); |
1975 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); | 1978 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); |
1976 } | 1979 } |
1977 | 1980 |
1978 } // namespace | 1981 } // namespace |
1979 } // namespace cc | 1982 } // namespace cc |
OLD | NEW |