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 7679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7690 | 7690 |
7691 inner_viewport_scroll_layer->SetScrollClipLayerId( | 7691 inner_viewport_scroll_layer->SetScrollClipLayerId( |
7692 inner_viewport_container_layer->id()); | 7692 inner_viewport_container_layer->id()); |
7693 outer_viewport_scroll_layer->SetScrollClipLayerId( | 7693 outer_viewport_scroll_layer->SetScrollClipLayerId( |
7694 outer_viewport_container_layer->id()); | 7694 outer_viewport_container_layer->id()); |
7695 | 7695 |
7696 inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true); | 7696 inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true); |
7697 outer_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true); | 7697 outer_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true); |
7698 | 7698 |
7699 host()->SetRootLayer(root); | 7699 host()->SetRootLayer(root); |
7700 host()->RegisterViewportLayers(nullptr, root, inner_viewport_scroll_layer, | 7700 host()->GetLayerTree()->RegisterViewportLayers( |
7701 outer_viewport_scroll_layer); | 7701 nullptr, root, inner_viewport_scroll_layer, outer_viewport_scroll_layer); |
7702 | 7702 |
7703 scoped_refptr<Layer> fixed_to_inner = Layer::Create(); | 7703 scoped_refptr<Layer> fixed_to_inner = Layer::Create(); |
7704 scoped_refptr<Layer> fixed_to_outer = Layer::Create(); | 7704 scoped_refptr<Layer> fixed_to_outer = Layer::Create(); |
7705 | 7705 |
7706 inner_viewport_scroll_layer->AddChild(fixed_to_inner); | 7706 inner_viewport_scroll_layer->AddChild(fixed_to_inner); |
7707 outer_viewport_scroll_layer->AddChild(fixed_to_outer); | 7707 outer_viewport_scroll_layer->AddChild(fixed_to_outer); |
7708 | 7708 |
7709 LayerPositionConstraint fixed_to_right; | 7709 LayerPositionConstraint fixed_to_right; |
7710 fixed_to_right.set_is_fixed_position(true); | 7710 fixed_to_right.set_is_fixed_position(true); |
7711 fixed_to_right.set_is_fixed_to_right_edge(true); | 7711 fixed_to_right.set_is_fixed_to_right_edge(true); |
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9485 MainThreadScrollingReason::kScrollbarScrolling); | 9485 MainThreadScrollingReason::kScrollbarScrolling); |
9486 | 9486 |
9487 child7->SetScrollClipLayerId(parent3->id()); | 9487 child7->SetScrollClipLayerId(parent3->id()); |
9488 | 9488 |
9489 child8->SetScrollParent(child7.get()); | 9489 child8->SetScrollParent(child7.get()); |
9490 grand_child11->SetScrollClipLayerId(parent3->id()); | 9490 grand_child11->SetScrollClipLayerId(parent3->id()); |
9491 | 9491 |
9492 parent5->SetNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50)); | 9492 parent5->SetNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50)); |
9493 parent5->SetBounds(gfx::Size(10, 10)); | 9493 parent5->SetBounds(gfx::Size(10, 10)); |
9494 | 9494 |
9495 host()->RegisterViewportLayers(nullptr, page_scale_layer, parent2, nullptr); | 9495 host()->GetLayerTree()->RegisterViewportLayers(nullptr, page_scale_layer, |
| 9496 parent2, nullptr); |
9496 ExecuteCalculateDrawPropertiesWithPropertyTrees(root1.get()); | 9497 ExecuteCalculateDrawPropertiesWithPropertyTrees(root1.get()); |
9497 | 9498 |
9498 const int kInvalidPropertyTreeNodeId = -1; | 9499 const int kInvalidPropertyTreeNodeId = -1; |
9499 const int kRootPropertyTreeNodeId = 0; | 9500 const int kRootPropertyTreeNodeId = 0; |
9500 | 9501 |
9501 // Property tree root | 9502 // Property tree root |
9502 ScrollTree& scroll_tree = host()->property_trees()->scroll_tree; | 9503 ScrollTree& scroll_tree = host()->property_trees()->scroll_tree; |
9503 PropertyTrees property_trees; | 9504 PropertyTrees property_trees; |
9504 property_trees.is_main_thread = true; | 9505 property_trees.is_main_thread = true; |
9505 property_trees.is_active = false; | 9506 property_trees.is_active = false; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9598 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 9599 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
9599 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 9600 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
9600 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 9601 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
9601 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 9602 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
9602 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 9603 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
9603 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 9604 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
9604 } | 9605 } |
9605 | 9606 |
9606 } // namespace | 9607 } // namespace |
9607 } // namespace cc | 9608 } // namespace cc |
OLD | NEW |