OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/layer_position_constraint.h" | 5 #include "cc/layers/layer_position_constraint.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 grand_child_->AddChild(great_grand_child_); | 126 grand_child_->AddChild(great_grand_child_); |
127 child_->AddChild(grand_child_); | 127 child_->AddChild(grand_child_); |
128 child_transform_layer_->AddChild(child_); | 128 child_transform_layer_->AddChild(child_); |
129 outer_viewport_container_layer_->AddChild(child_transform_layer_); | 129 outer_viewport_container_layer_->AddChild(child_transform_layer_); |
130 scroll_layer_->AddChild(outer_viewport_container_layer_); | 130 scroll_layer_->AddChild(outer_viewport_container_layer_); |
131 inner_viewport_container_layer_->AddChild(scroll_layer_); | 131 inner_viewport_container_layer_->AddChild(scroll_layer_); |
132 root_->AddChild(inner_viewport_container_layer_); | 132 root_->AddChild(inner_viewport_container_layer_); |
133 | 133 |
134 layer_tree_host_->SetRootLayer(root_); | 134 layer_tree_host_->SetRootLayer(root_); |
135 layer_tree_host_->GetLayerTree()->RegisterViewportLayers( | 135 layer_tree_host_->RegisterViewportLayers(nullptr, root_, scroll_layer_, |
136 nullptr, root_, scroll_layer_, child_); | 136 child_); |
137 } | 137 } |
138 | 138 |
139 void CommitAndUpdateImplPointers() { | 139 void CommitAndUpdateImplPointers() { |
140 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 140 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
141 root_.get(), root_->bounds()); | 141 root_.get(), root_->bounds()); |
142 inputs.inner_viewport_scroll_layer = | 142 inputs.inner_viewport_scroll_layer = |
143 layer_tree_host_->GetLayerTree()->inner_viewport_scroll_layer(); | 143 layer_tree_host_->inner_viewport_scroll_layer(); |
144 inputs.outer_viewport_scroll_layer = | 144 inputs.outer_viewport_scroll_layer = |
145 layer_tree_host_->GetLayerTree()->outer_viewport_scroll_layer(); | 145 layer_tree_host_->outer_viewport_scroll_layer(); |
146 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 146 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
147 | 147 |
148 // Since scroll deltas aren't sent back to the main thread in this test | 148 // Since scroll deltas aren't sent back to the main thread in this test |
149 // setup, clear them to maintain consistent state. | 149 // setup, clear them to maintain consistent state. |
150 if (root_impl_) { | 150 if (root_impl_) { |
151 SetScrollOffsetDelta(scroll_layer_impl_, gfx::Vector2dF()); | 151 SetScrollOffsetDelta(scroll_layer_impl_, gfx::Vector2dF()); |
152 SetScrollOffsetDelta(child_impl_, gfx::Vector2dF()); | 152 SetScrollOffsetDelta(child_impl_, gfx::Vector2dF()); |
153 SetScrollOffsetDelta(grand_child_impl_, gfx::Vector2dF()); | 153 SetScrollOffsetDelta(grand_child_impl_, gfx::Vector2dF()); |
154 } | 154 } |
155 root_impl_ = layer_tree_host_->CommitAndCreateLayerImplTree(); | 155 root_impl_ = layer_tree_host_->CommitAndCreateLayerImplTree(); |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 VerifySerializeAndDeserializeProto(true, false, true); | 1165 VerifySerializeAndDeserializeProto(true, false, true); |
1166 VerifySerializeAndDeserializeProto(true, false, false); | 1166 VerifySerializeAndDeserializeProto(true, false, false); |
1167 VerifySerializeAndDeserializeProto(false, true, true); | 1167 VerifySerializeAndDeserializeProto(false, true, true); |
1168 VerifySerializeAndDeserializeProto(false, true, false); | 1168 VerifySerializeAndDeserializeProto(false, true, false); |
1169 VerifySerializeAndDeserializeProto(false, false, true); | 1169 VerifySerializeAndDeserializeProto(false, false, true); |
1170 VerifySerializeAndDeserializeProto(false, false, false); | 1170 VerifySerializeAndDeserializeProto(false, false, false); |
1171 } | 1171 } |
1172 | 1172 |
1173 } // namespace | 1173 } // namespace |
1174 } // namespace cc | 1174 } // namespace cc |
OLD | NEW |