| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 RunManageTilesTest("5_1000", 5, 1000); | 344 RunManageTilesTest("5_1000", 5, 1000); |
| 345 RunManageTilesTest("10_100", 10, 100); | 345 RunManageTilesTest("10_100", 10, 100); |
| 346 RunManageTilesTest("10_500", 10, 500); | 346 RunManageTilesTest("10_500", 10, 500); |
| 347 RunManageTilesTest("10_1000", 10, 1000); | 347 RunManageTilesTest("10_1000", 10, 1000); |
| 348 RunManageTilesTest("100_100", 100, 100); | 348 RunManageTilesTest("100_100", 100, 100); |
| 349 RunManageTilesTest("100_500", 100, 500); | 349 RunManageTilesTest("100_500", 100, 500); |
| 350 RunManageTilesTest("100_1000", 100, 1000); | 350 RunManageTilesTest("100_1000", 100, 1000); |
| 351 } | 351 } |
| 352 | 352 |
| 353 TEST_F(TileManagerPerfTest, RasterTileQueueConstruct) { | 353 TEST_F(TileManagerPerfTest, RasterTileQueueConstruct) { |
| 354 SetupDefaultTrees(gfx::Size(10000, 10000)); | 354 SetupDefaultTrees(gfx::Size(1000, 1000)); |
| 355 active_root_layer_->CreateDefaultTilingsAndTiles(); | 355 active_root_layer_->CreateDefaultTilingsAndTiles(); |
| 356 pending_root_layer_->CreateDefaultTilingsAndTiles(); | 356 pending_root_layer_->CreateDefaultTilingsAndTiles(); |
| 357 | 357 |
| 358 RunRasterQueueConstructTest("2"); | 358 RunRasterQueueConstructTest("2"); |
| 359 | 359 |
| 360 for (int i = 0; i < 8; ++i) { | 360 int number_of_tilings = 2; |
| 361 PictureLayerTiling* tiling = active_root_layer_->AddTiling(i * 0.3f); | 361 for (; number_of_tilings < 10; ++number_of_tilings) { |
| 362 PictureLayerTiling* tiling = |
| 363 active_root_layer_->AddTiling(1.0f + number_of_tilings * 0.3f); |
| 362 tiling->CreateAllTilesForTesting(); | 364 tiling->CreateAllTilesForTesting(); |
| 363 } | 365 } |
| 364 | 366 |
| 365 RunRasterQueueConstructTest("10"); | 367 RunRasterQueueConstructTest("10"); |
| 366 | 368 |
| 367 for (int i = 0; i < 90; ++i) { | 369 for (; number_of_tilings < 50; ++number_of_tilings) { |
| 368 PictureLayerTiling* tiling = | 370 PictureLayerTiling* tiling = |
| 369 active_root_layer_->AddTiling(1.0f + i * 0.03f); | 371 active_root_layer_->AddTiling(1.0f + number_of_tilings * 0.3f); |
| 370 tiling->CreateAllTilesForTesting(); | 372 tiling->CreateAllTilesForTesting(); |
| 371 } | 373 } |
| 372 | 374 |
| 373 RunRasterQueueConstructTest("100"); | 375 RunRasterQueueConstructTest("50"); |
| 374 } | 376 } |
| 375 | 377 |
| 376 TEST_F(TileManagerPerfTest, RasterTileQueueConstructAndIterate) { | 378 TEST_F(TileManagerPerfTest, RasterTileQueueConstructAndIterate) { |
| 377 SetupDefaultTrees(gfx::Size(10000, 10000)); | 379 SetupDefaultTrees(gfx::Size(10000, 10000)); |
| 378 active_root_layer_->CreateDefaultTilingsAndTiles(); | 380 active_root_layer_->CreateDefaultTilingsAndTiles(); |
| 379 pending_root_layer_->CreateDefaultTilingsAndTiles(); | 381 pending_root_layer_->CreateDefaultTilingsAndTiles(); |
| 380 | 382 |
| 381 RunRasterQueueConstructAndIterateTest("2_16", 16); | 383 RunRasterQueueConstructAndIterateTest("2_16", 16); |
| 382 RunRasterQueueConstructAndIterateTest("2_32", 32); | 384 RunRasterQueueConstructAndIterateTest("2_32", 32); |
| 383 RunRasterQueueConstructAndIterateTest("2_64", 64); | 385 RunRasterQueueConstructAndIterateTest("2_64", 64); |
| 384 RunRasterQueueConstructAndIterateTest("2_128", 128); | 386 RunRasterQueueConstructAndIterateTest("2_128", 128); |
| 385 } | 387 } |
| 386 | 388 |
| 387 } // namespace | 389 } // namespace |
| 388 | 390 |
| 389 } // namespace cc | 391 } // namespace cc |
| OLD | NEW |