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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (it.represents_contributing_render_surface()) | 87 if (it.represents_contributing_render_surface()) |
88 layer->count_representing_contributing_surface_ = count; | 88 layer->count_representing_contributing_surface_ = count; |
89 if (it.represents_itself()) | 89 if (it.represents_itself()) |
90 layer->count_representing_itself_ = count; | 90 layer->count_representing_itself_ = count; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 class LayerIteratorTest : public testing::Test { | 94 class LayerIteratorTest : public testing::Test { |
95 public: | 95 public: |
96 LayerIteratorTest() | 96 LayerIteratorTest() |
97 : host_impl_(&task_runner_provider_, | 97 : host_impl_(&task_runner_provider_, &task_graph_runner_), id_(1) {} |
98 &shared_bitmap_manager_, | |
99 &task_graph_runner_), | |
100 id_(1) {} | |
101 | 98 |
102 std::unique_ptr<TestLayerImpl> CreateLayer() { | 99 std::unique_ptr<TestLayerImpl> CreateLayer() { |
103 return TestLayerImpl::Create(host_impl_.active_tree(), id_++); | 100 return TestLayerImpl::Create(host_impl_.active_tree(), id_++); |
104 } | 101 } |
105 | 102 |
106 protected: | 103 protected: |
107 FakeImplTaskRunnerProvider task_runner_provider_; | 104 FakeImplTaskRunnerProvider task_runner_provider_; |
108 TestSharedBitmapManager shared_bitmap_manager_; | |
109 TestTaskGraphRunner task_graph_runner_; | 105 TestTaskGraphRunner task_graph_runner_; |
110 FakeLayerTreeHostImpl host_impl_; | 106 FakeLayerTreeHostImpl host_impl_; |
111 | 107 |
112 int id_; | 108 int id_; |
113 }; | 109 }; |
114 | 110 |
115 TEST_F(LayerIteratorTest, EmptyTree) { | 111 TEST_F(LayerIteratorTest, EmptyTree) { |
116 LayerImplList render_surface_layer_list; | 112 LayerImplList render_surface_layer_list; |
117 | 113 |
118 IterateFrontToBack(&render_surface_layer_list); | 114 IterateFrontToBack(&render_surface_layer_list); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 EXPECT_COUNT(root21_ptr, -1, -1, 9); | 244 EXPECT_COUNT(root21_ptr, -1, -1, 9); |
249 EXPECT_COUNT(root22_ptr, 7, 8, 6); | 245 EXPECT_COUNT(root22_ptr, 7, 8, 6); |
250 EXPECT_COUNT(root221_ptr, -1, -1, 5); | 246 EXPECT_COUNT(root221_ptr, -1, -1, 5); |
251 EXPECT_COUNT(root23_ptr, 3, 4, 2); | 247 EXPECT_COUNT(root23_ptr, 3, 4, 2); |
252 EXPECT_COUNT(root231_ptr, -1, -1, 1); | 248 EXPECT_COUNT(root231_ptr, -1, -1, 1); |
253 EXPECT_COUNT(root3_ptr, -1, -1, 0); | 249 EXPECT_COUNT(root3_ptr, -1, -1, 0); |
254 } | 250 } |
255 | 251 |
256 } // namespace | 252 } // namespace |
257 } // namespace cc | 253 } // namespace cc |
OLD | NEW |