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 "base/time/time.h" | 5 #include "base/time/time.h" |
6 #include "cc/debug/lap_timer.h" | 6 #include "cc/debug/lap_timer.h" |
7 #include "cc/resources/tile.h" | 7 #include "cc/resources/tile.h" |
8 #include "cc/resources/tile_priority.h" | 8 #include "cc/resources/tile_priority.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 active_root_layer_->SetAllTilesVisible(); | 173 active_root_layer_->SetAllTilesVisible(); |
174 pending_root_layer_->CreateDefaultTilingsAndTiles(); | 174 pending_root_layer_->CreateDefaultTilingsAndTiles(); |
175 pending_root_layer_->SetAllTilesVisible(); | 175 pending_root_layer_->SetAllTilesVisible(); |
176 } | 176 } |
177 | 177 |
178 void RunRasterIteratorTest(const std::string& test_name, | 178 void RunRasterIteratorTest(const std::string& test_name, |
179 unsigned tile_count) { | 179 unsigned tile_count) { |
180 timer_.Reset(); | 180 timer_.Reset(); |
181 do { | 181 do { |
182 int count = tile_count; | 182 int count = tile_count; |
183 for (TileManager::RasterTileIterator it(tile_manager(), | 183 TilePriorityQueue* queue = |
184 SAME_PRIORITY_FOR_BOTH_TREES); | 184 host_impl_.RebuildRasterQueue(SAME_PRIORITY_FOR_BOTH_TREES); |
185 it && count; | 185 for (; !queue->IsEmpty() && count; queue->Pop()) { |
186 ++it) { | |
187 --count; | 186 --count; |
188 } | 187 } |
189 ASSERT_EQ(0, count); | 188 ASSERT_EQ(0, count); |
190 timer_.NextLap(); | 189 timer_.NextLap(); |
191 } while (!timer_.HasTimeLimitExpired()); | 190 } while (!timer_.HasTimeLimitExpired()); |
192 | 191 |
193 perf_test::PrintResult("tile_manager_raster_tile_iterator", | 192 perf_test::PrintResult("tile_manager_raster_tile_iterator", |
194 "", | 193 "", |
195 test_name, | 194 test_name, |
196 timer_.LapsPerSecond(), | 195 timer_.LapsPerSecond(), |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 329 |
331 RunRasterIteratorTest("2_16", 16); | 330 RunRasterIteratorTest("2_16", 16); |
332 RunRasterIteratorTest("2_32", 32); | 331 RunRasterIteratorTest("2_32", 32); |
333 RunRasterIteratorTest("2_64", 64); | 332 RunRasterIteratorTest("2_64", 64); |
334 RunRasterIteratorTest("2_128", 128); | 333 RunRasterIteratorTest("2_128", 128); |
335 } | 334 } |
336 | 335 |
337 } // namespace | 336 } // namespace |
338 | 337 |
339 } // namespace cc | 338 } // namespace cc |
OLD | NEW |