OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_iterator.h" | 5 #include "cc/layers/layer_iterator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 TestLayerImpl* first_ptr = first.get(); | 129 TestLayerImpl* first_ptr = first.get(); |
130 TestLayerImpl* second_ptr = second.get(); | 130 TestLayerImpl* second_ptr = second.get(); |
131 TestLayerImpl* third_ptr = third.get(); | 131 TestLayerImpl* third_ptr = third.get(); |
132 TestLayerImpl* fourth_ptr = fourth.get(); | 132 TestLayerImpl* fourth_ptr = fourth.get(); |
133 | 133 |
134 root_layer->test_properties()->AddChild(std::move(first)); | 134 root_layer->test_properties()->AddChild(std::move(first)); |
135 root_layer->test_properties()->AddChild(std::move(second)); | 135 root_layer->test_properties()->AddChild(std::move(second)); |
136 root_layer->test_properties()->AddChild(std::move(third)); | 136 root_layer->test_properties()->AddChild(std::move(third)); |
137 root_layer->test_properties()->AddChild(std::move(fourth)); | 137 root_layer->test_properties()->AddChild(std::move(fourth)); |
138 | 138 |
139 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); | 139 host_impl_.active_tree()->SetRootLayerForTesting(std::move(root_layer)); |
140 | 140 |
141 LayerImplList render_surface_layer_list; | 141 LayerImplList render_surface_layer_list; |
142 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 142 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
143 root_ptr, root_ptr->bounds(), &render_surface_layer_list); | 143 root_ptr, root_ptr->bounds(), &render_surface_layer_list); |
144 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 144 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
145 | 145 |
146 IterateFrontToBack(&render_surface_layer_list); | 146 IterateFrontToBack(&render_surface_layer_list); |
147 EXPECT_COUNT(root_ptr, 5, -1, 4); | 147 EXPECT_COUNT(root_ptr, 5, -1, 4); |
148 EXPECT_COUNT(first_ptr, -1, -1, 3); | 148 EXPECT_COUNT(first_ptr, -1, -1, 3); |
149 EXPECT_COUNT(second_ptr, -1, -1, 2); | 149 EXPECT_COUNT(second_ptr, -1, -1, 2); |
(...skipping 24 matching lines...) Expand all Loading... |
174 | 174 |
175 root22->test_properties()->AddChild(std::move(root221)); | 175 root22->test_properties()->AddChild(std::move(root221)); |
176 root23->test_properties()->AddChild(std::move(root231)); | 176 root23->test_properties()->AddChild(std::move(root231)); |
177 root2->test_properties()->AddChild(std::move(root21)); | 177 root2->test_properties()->AddChild(std::move(root21)); |
178 root2->test_properties()->AddChild(std::move(root22)); | 178 root2->test_properties()->AddChild(std::move(root22)); |
179 root2->test_properties()->AddChild(std::move(root23)); | 179 root2->test_properties()->AddChild(std::move(root23)); |
180 root_layer->test_properties()->AddChild(std::move(root1)); | 180 root_layer->test_properties()->AddChild(std::move(root1)); |
181 root_layer->test_properties()->AddChild(std::move(root2)); | 181 root_layer->test_properties()->AddChild(std::move(root2)); |
182 root_layer->test_properties()->AddChild(std::move(root3)); | 182 root_layer->test_properties()->AddChild(std::move(root3)); |
183 | 183 |
184 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); | 184 host_impl_.active_tree()->SetRootLayerForTesting(std::move(root_layer)); |
185 | 185 |
186 LayerImplList render_surface_layer_list; | 186 LayerImplList render_surface_layer_list; |
187 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 187 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
188 root_ptr, root_ptr->bounds(), &render_surface_layer_list); | 188 root_ptr, root_ptr->bounds(), &render_surface_layer_list); |
189 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 189 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
190 | 190 |
191 IterateFrontToBack(&render_surface_layer_list); | 191 IterateFrontToBack(&render_surface_layer_list); |
192 EXPECT_COUNT(root_ptr, 9, -1, 8); | 192 EXPECT_COUNT(root_ptr, 9, -1, 8); |
193 EXPECT_COUNT(root1_ptr, -1, -1, 7); | 193 EXPECT_COUNT(root1_ptr, -1, -1, 7); |
194 EXPECT_COUNT(root2_ptr, -1, -1, 6); | 194 EXPECT_COUNT(root2_ptr, -1, -1, 6); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 root22->test_properties()->AddChild(std::move(root221)); | 227 root22->test_properties()->AddChild(std::move(root221)); |
228 root23->test_properties()->AddChild(std::move(root231)); | 228 root23->test_properties()->AddChild(std::move(root231)); |
229 root2->SetDrawsContent(false); | 229 root2->SetDrawsContent(false); |
230 root2->test_properties()->AddChild(std::move(root21)); | 230 root2->test_properties()->AddChild(std::move(root21)); |
231 root2->test_properties()->AddChild(std::move(root22)); | 231 root2->test_properties()->AddChild(std::move(root22)); |
232 root2->test_properties()->AddChild(std::move(root23)); | 232 root2->test_properties()->AddChild(std::move(root23)); |
233 root_layer->test_properties()->AddChild(std::move(root1)); | 233 root_layer->test_properties()->AddChild(std::move(root1)); |
234 root_layer->test_properties()->AddChild(std::move(root2)); | 234 root_layer->test_properties()->AddChild(std::move(root2)); |
235 root_layer->test_properties()->AddChild(std::move(root3)); | 235 root_layer->test_properties()->AddChild(std::move(root3)); |
236 | 236 |
237 host_impl_.active_tree()->SetRootLayer(std::move(root_layer)); | 237 host_impl_.active_tree()->SetRootLayerForTesting(std::move(root_layer)); |
238 | 238 |
239 LayerImplList render_surface_layer_list; | 239 LayerImplList render_surface_layer_list; |
240 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 240 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
241 root_ptr, root_ptr->bounds(), &render_surface_layer_list); | 241 root_ptr, root_ptr->bounds(), &render_surface_layer_list); |
242 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); | 242 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); |
243 | 243 |
244 IterateFrontToBack(&render_surface_layer_list); | 244 IterateFrontToBack(&render_surface_layer_list); |
245 EXPECT_COUNT(root_ptr, 14, -1, 13); | 245 EXPECT_COUNT(root_ptr, 14, -1, 13); |
246 EXPECT_COUNT(root1_ptr, -1, -1, 12); | 246 EXPECT_COUNT(root1_ptr, -1, -1, 12); |
247 EXPECT_COUNT(root2_ptr, 10, 11, -1); | 247 EXPECT_COUNT(root2_ptr, 10, 11, -1); |
248 EXPECT_COUNT(root21_ptr, -1, -1, 9); | 248 EXPECT_COUNT(root21_ptr, -1, -1, 9); |
249 EXPECT_COUNT(root22_ptr, 7, 8, 6); | 249 EXPECT_COUNT(root22_ptr, 7, 8, 6); |
250 EXPECT_COUNT(root221_ptr, -1, -1, 5); | 250 EXPECT_COUNT(root221_ptr, -1, -1, 5); |
251 EXPECT_COUNT(root23_ptr, 3, 4, 2); | 251 EXPECT_COUNT(root23_ptr, 3, 4, 2); |
252 EXPECT_COUNT(root231_ptr, -1, -1, 1); | 252 EXPECT_COUNT(root231_ptr, -1, -1, 1); |
253 EXPECT_COUNT(root3_ptr, -1, -1, 0); | 253 EXPECT_COUNT(root3_ptr, -1, -1, 0); |
254 } | 254 } |
255 | 255 |
256 } // namespace | 256 } // namespace |
257 } // namespace cc | 257 } // namespace cc |
OLD | NEW |