| 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/raster_tile_priority_queue.h" |
| 7 #include "cc/resources/tile.h" | 8 #include "cc/resources/tile.h" |
| 8 #include "cc/resources/tile_priority.h" | 9 #include "cc/resources/tile_priority.h" |
| 9 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 11 #include "cc/test/fake_layer_tree_host_impl.h" |
| 11 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
| 12 #include "cc/test/fake_output_surface_client.h" | 13 #include "cc/test/fake_output_surface_client.h" |
| 13 #include "cc/test/fake_picture_layer_impl.h" | 14 #include "cc/test/fake_picture_layer_impl.h" |
| 14 #include "cc/test/fake_picture_pile_impl.h" | 15 #include "cc/test/fake_picture_pile_impl.h" |
| 15 #include "cc/test/fake_tile_manager.h" | 16 #include "cc/test/fake_tile_manager.h" |
| 16 #include "cc/test/fake_tile_manager_client.h" | 17 #include "cc/test/fake_tile_manager_client.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 active_root_layer_->SetAllTilesVisible(); | 174 active_root_layer_->SetAllTilesVisible(); |
| 174 pending_root_layer_->CreateDefaultTilingsAndTiles(); | 175 pending_root_layer_->CreateDefaultTilingsAndTiles(); |
| 175 pending_root_layer_->SetAllTilesVisible(); | 176 pending_root_layer_->SetAllTilesVisible(); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void RunRasterIteratorTest(const std::string& test_name, | 179 void RunRasterIteratorTest(const std::string& test_name, |
| 179 unsigned tile_count) { | 180 unsigned tile_count) { |
| 180 timer_.Reset(); | 181 timer_.Reset(); |
| 181 do { | 182 do { |
| 182 int count = tile_count; | 183 int count = tile_count; |
| 183 for (TileManager::RasterTileIterator it(tile_manager(), | 184 RasterTilePriorityQueue queue; |
| 184 SAME_PRIORITY_FOR_BOTH_TREES); | 185 host_impl_.BuildRasterQueue(&queue, SAME_PRIORITY_FOR_BOTH_TREES); |
| 185 it && count; | 186 for (; !queue.IsEmpty() && count; queue.Pop()) { |
| 186 ++it) { | |
| 187 --count; | 187 --count; |
| 188 } | 188 } |
| 189 ASSERT_EQ(0, count); | 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(), |
| (...skipping 133 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 |