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 "cc/resources/tile.h" | 5 #include "cc/resources/tile.h" |
6 #include "cc/resources/tile_priority.h" | 6 #include "cc/resources/tile_priority.h" |
7 #include "cc/test/fake_output_surface.h" | 7 #include "cc/test/fake_output_surface.h" |
8 #include "cc/test/fake_output_surface_client.h" | 8 #include "cc/test/fake_output_surface_client.h" |
9 #include "cc/test/fake_picture_pile_impl.h" | 9 #include "cc/test/fake_picture_pile_impl.h" |
10 #include "cc/test/fake_tile_manager.h" | 10 #include "cc/test/fake_tile_manager.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // Allocated bytes should never be more than the memory limit. | 526 // Allocated bytes should never be more than the memory limit. |
527 EXPECT_LE(memory_allocated_bytes, global_state_.memory_limit_in_bytes); | 527 EXPECT_LE(memory_allocated_bytes, global_state_.memory_limit_in_bytes); |
528 } | 528 } |
529 | 529 |
530 // If true, the max tile limit should be applied as bytes; if false, | 530 // If true, the max tile limit should be applied as bytes; if false, |
531 // as num_resources_limit. | 531 // as num_resources_limit. |
532 INSTANTIATE_TEST_CASE_P(TileManagerTests, | 532 INSTANTIATE_TEST_CASE_P(TileManagerTests, |
533 TileManagerTest, | 533 TileManagerTest, |
534 ::testing::Values(true, false)); | 534 ::testing::Values(true, false)); |
535 | 535 |
| 536 TEST_P(TileManagerTest, TileManagerGpuRasterizationRouting) { |
| 537 // Ensure that tiles marked for gpu rasterization |
| 538 // get sent to the GpuRasterizer. |
| 539 |
| 540 Initialize(3, ALLOW_ABSOLUTE_MINIMUM, SMOOTHNESS_TAKES_PRIORITY); |
| 541 TileVector active_now = |
| 542 CreateTiles(3, TilePriorityForNowBin(), TilePriority()); |
| 543 active_now[0]->set_use_gpu_rasterizer(true); |
| 544 active_now[1]->set_use_gpu_rasterizer(true); |
| 545 |
| 546 tile_manager()->ManageTiles(global_state_); |
| 547 EXPECT_EQ(2, tile_manager()->CompletedGpuRasterizedTiles()); |
| 548 tile_manager()->CheckForCompletedTasks(); |
| 549 } |
| 550 |
536 } // namespace | 551 } // namespace |
537 } // namespace cc | 552 } // namespace cc |
538 | 553 |
OLD | NEW |