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/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/thread_task_runner_handle.h" | 6 #include "base/thread_task_runner_handle.h" |
7 #include "cc/resources/resource_pool.h" | 7 #include "cc/resources/resource_pool.h" |
8 #include "cc/test/begin_frame_args_test.h" | 8 #include "cc/test/begin_frame_args_test.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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 | 1379 |
1380 // Verify that the queue has a required for draw tile at Top. | 1380 // Verify that the queue has a required for draw tile at Top. |
1381 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( | 1381 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( |
1382 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); | 1382 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); |
1383 EXPECT_FALSE(queue->IsEmpty()); | 1383 EXPECT_FALSE(queue->IsEmpty()); |
1384 EXPECT_TRUE(queue->Top().tile()->required_for_draw()); | 1384 EXPECT_TRUE(queue->Top().tile()->required_for_draw()); |
1385 EXPECT_EQ(gfx::Size(256, 256), queue->Top().tile()->desired_texture_size()); | 1385 EXPECT_EQ(gfx::Size(256, 256), queue->Top().tile()->desired_texture_size()); |
1386 EXPECT_EQ(RGBA_8888, host_impl_.resource_provider()->best_texture_format()); | 1386 EXPECT_EQ(RGBA_8888, host_impl_.resource_provider()->best_texture_format()); |
1387 | 1387 |
1388 ManagedMemoryPolicy policy = host_impl_.ActualManagedMemoryPolicy(); | 1388 ManagedMemoryPolicy policy = host_impl_.ActualManagedMemoryPolicy(); |
1389 policy.bytes_limit_when_visible = | 1389 policy.bytes_limit_when_visible = ResourceUtil::UncheckedSizeInBytes<size_t>( |
1390 Resource::UncheckedMemorySizeBytes(gfx::Size(256, 256), RGBA_8888); | 1390 gfx::Size(256, 256), RGBA_8888); |
1391 host_impl_.SetMemoryPolicy(policy); | 1391 host_impl_.SetMemoryPolicy(policy); |
1392 | 1392 |
1393 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); | 1393 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); |
1394 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); | 1394 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); |
1395 EXPECT_TRUE(host_impl_.is_likely_to_require_a_draw()); | 1395 EXPECT_TRUE(host_impl_.is_likely_to_require_a_draw()); |
1396 | 1396 |
1397 scoped_ptr<ScopedResource> resource = | 1397 scoped_ptr<ScopedResource> resource = |
1398 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256), | 1398 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256), |
1399 RGBA_8888); | 1399 RGBA_8888); |
1400 | 1400 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 .WillOnce(testing::Invoke([&run_loop]() { run_loop.Quit(); })); | 1510 .WillOnce(testing::Invoke([&run_loop]() { run_loop.Quit(); })); |
1511 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); | 1511 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); |
1512 host_impl_.tile_manager()->SetMoreTilesNeedToBeRasterizedForTesting(); | 1512 host_impl_.tile_manager()->SetMoreTilesNeedToBeRasterizedForTesting(); |
1513 EXPECT_TRUE(host_impl_.tile_manager()->HasScheduledTileTasksForTesting()); | 1513 EXPECT_TRUE(host_impl_.tile_manager()->HasScheduledTileTasksForTesting()); |
1514 run_loop.Run(); | 1514 run_loop.Run(); |
1515 } | 1515 } |
1516 } | 1516 } |
1517 | 1517 |
1518 } // namespace | 1518 } // namespace |
1519 } // namespace cc | 1519 } // namespace cc |
OLD | NEW |