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/playback/display_list_raster_source.h" | 7 #include "cc/playback/display_list_raster_source.h" |
8 #include "cc/playback/display_list_recording_source.h" | 8 #include "cc/playback/display_list_recording_source.h" |
9 #include "cc/raster/raster_buffer.h" | 9 #include "cc/raster/raster_buffer.h" |
10 #include "cc/resources/resource_pool.h" | 10 #include "cc/resources/resource_pool.h" |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 | 1356 |
1357 Resource* resource = host_impl_.resource_pool()->AcquireResource( | 1357 Resource* resource = host_impl_.resource_pool()->AcquireResource( |
1358 gfx::Size(256, 256), RGBA_8888); | 1358 gfx::Size(256, 256), RGBA_8888); |
1359 | 1359 |
1360 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); | 1360 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); |
1361 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); | 1361 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); |
1362 | 1362 |
1363 host_impl_.resource_pool()->ReleaseResource(resource, 0); | 1363 host_impl_.resource_pool()->ReleaseResource(resource, 0); |
1364 } | 1364 } |
1365 | 1365 |
| 1366 TEST_F(TileManagerTilePriorityQueueTest, DefaultMemoryPolicy) { |
| 1367 const gfx::Size layer_bounds(1000, 1000); |
| 1368 host_impl_.SetViewportSize(layer_bounds); |
| 1369 SetupDefaultTrees(layer_bounds); |
| 1370 |
| 1371 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); |
| 1372 |
| 1373 // 64MB is the default mem limit. |
| 1374 EXPECT_EQ(67108864u, |
| 1375 host_impl_.global_tile_state().hard_memory_limit_in_bytes); |
| 1376 EXPECT_EQ(TileMemoryLimitPolicy::ALLOW_ANYTHING, |
| 1377 host_impl_.global_tile_state().memory_limit_policy); |
| 1378 EXPECT_EQ(ManagedMemoryPolicy::kDefaultNumResourcesLimit, |
| 1379 host_impl_.global_tile_state().num_resources_limit); |
| 1380 } |
| 1381 |
1366 TEST_F(TileManagerTilePriorityQueueTest, RasterQueueAllUsesCorrectTileBounds) { | 1382 TEST_F(TileManagerTilePriorityQueueTest, RasterQueueAllUsesCorrectTileBounds) { |
1367 // Verify that we use the real tile bounds when advancing phases during the | 1383 // Verify that we use the real tile bounds when advancing phases during the |
1368 // tile iteration. | 1384 // tile iteration. |
1369 gfx::Size layer_bounds(1, 1); | 1385 gfx::Size layer_bounds(1, 1); |
1370 | 1386 |
1371 scoped_refptr<FakeDisplayListRasterSource> raster_source = | 1387 scoped_refptr<FakeDisplayListRasterSource> raster_source = |
1372 FakeDisplayListRasterSource::CreateFilled(layer_bounds); | 1388 FakeDisplayListRasterSource::CreateFilled(layer_bounds); |
1373 | 1389 |
1374 FakePictureLayerTilingClient pending_client; | 1390 FakePictureLayerTilingClient pending_client; |
1375 pending_client.SetTileSize(gfx::Size(64, 64)); | 1391 pending_client.SetTileSize(gfx::Size(64, 64)); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 EXPECT_FALSE(host_impl_->resource_pool()->TryAcquireResourceWithContentId( | 1664 EXPECT_FALSE(host_impl_->resource_pool()->TryAcquireResourceWithContentId( |
1649 invalidated_id)); | 1665 invalidated_id)); |
1650 | 1666 |
1651 // Free our host_impl_ before the cancelling_runner we passed it, as it will | 1667 // Free our host_impl_ before the cancelling_runner we passed it, as it will |
1652 // use that class in clean up. | 1668 // use that class in clean up. |
1653 host_impl_ = nullptr; | 1669 host_impl_ = nullptr; |
1654 } | 1670 } |
1655 | 1671 |
1656 } // namespace | 1672 } // namespace |
1657 } // namespace cc | 1673 } // namespace cc |
OLD | NEW |