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 RasterTilePriorityQueue queue; |
184 SAME_PRIORITY_FOR_BOTH_TREES); | 184 host_impl_.BuildRasterQueue(&queue, SAME_PRIORITY_FOR_BOTH_TREES); |
185 it && count; | 185 while (count--) { |
186 ++it) { | 186 ASSERT_FALSE(queue.IsEmpty()); |
187 --count; | 187 ASSERT_TRUE(queue.Top() != NULL); |
| 188 queue.Pop(); |
188 } | 189 } |
189 ASSERT_EQ(0, count); | |
190 timer_.NextLap(); | 190 timer_.NextLap(); |
191 } while (!timer_.HasTimeLimitExpired()); | 191 } while (!timer_.HasTimeLimitExpired()); |
192 | 192 |
193 perf_test::PrintResult("tile_manager_raster_tile_iterator", | 193 perf_test::PrintResult("tile_manager_raster_tile_iterator", |
194 "", | 194 "", |
195 test_name, | 195 test_name, |
196 timer_.LapsPerSecond(), | 196 timer_.LapsPerSecond(), |
197 "runs/s", | 197 "runs/s", |
198 true); | 198 true); |
199 } | 199 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 RunRasterIteratorTest("2_16", 16); | 331 RunRasterIteratorTest("2_16", 16); |
332 RunRasterIteratorTest("2_32", 32); | 332 RunRasterIteratorTest("2_32", 32); |
333 RunRasterIteratorTest("2_64", 64); | 333 RunRasterIteratorTest("2_64", 64); |
334 RunRasterIteratorTest("2_128", 128); | 334 RunRasterIteratorTest("2_128", 128); |
335 } | 335 } |
336 | 336 |
337 } // namespace | 337 } // namespace |
338 | 338 |
339 } // namespace cc | 339 } // namespace cc |
OLD | NEW |