Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 1412923004: Revert of Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1367
1368 Resource* resource = host_impl_.resource_pool()->AcquireResource( 1368 Resource* resource = host_impl_.resource_pool()->AcquireResource(
1369 gfx::Size(256, 256), RGBA_8888); 1369 gfx::Size(256, 256), RGBA_8888);
1370 1370
1371 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); 1371 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting();
1372 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); 1372 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw());
1373 1373
1374 host_impl_.resource_pool()->ReleaseResource(resource, 0); 1374 host_impl_.resource_pool()->ReleaseResource(resource, 0);
1375 } 1375 }
1376 1376
1377 TEST_F(TileManagerTilePriorityQueueTest, DefaultMemoryPolicy) {
1378 const gfx::Size layer_bounds(1000, 1000);
1379 host_impl_.SetViewportSize(layer_bounds);
1380 SetupDefaultTrees(layer_bounds);
1381
1382 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state());
1383
1384 // 64MB is the default mem limit.
1385 EXPECT_EQ(67108864u,
1386 host_impl_.global_tile_state().hard_memory_limit_in_bytes);
1387 EXPECT_EQ(TileMemoryLimitPolicy::ALLOW_ANYTHING,
1388 host_impl_.global_tile_state().memory_limit_policy);
1389 EXPECT_EQ(ManagedMemoryPolicy::kDefaultNumResourcesLimit,
1390 host_impl_.global_tile_state().num_resources_limit);
1391 }
1392
1393 TEST_F(TileManagerTilePriorityQueueTest, RasterQueueAllUsesCorrectTileBounds) { 1377 TEST_F(TileManagerTilePriorityQueueTest, RasterQueueAllUsesCorrectTileBounds) {
1394 // Verify that we use the real tile bounds when advancing phases during the 1378 // Verify that we use the real tile bounds when advancing phases during the
1395 // tile iteration. 1379 // tile iteration.
1396 gfx::Size layer_bounds(1, 1); 1380 gfx::Size layer_bounds(1, 1);
1397 1381
1398 scoped_refptr<FakeDisplayListRasterSource> raster_source = 1382 scoped_refptr<FakeDisplayListRasterSource> raster_source =
1399 FakeDisplayListRasterSource::CreateFilled(layer_bounds); 1383 FakeDisplayListRasterSource::CreateFilled(layer_bounds);
1400 1384
1401 FakePictureLayerTilingClient pending_client; 1385 FakePictureLayerTilingClient pending_client;
1402 pending_client.SetTileSize(gfx::Size(64, 64)); 1386 pending_client.SetTileSize(gfx::Size(64, 64));
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 } 1785 }
1802 1786
1803 // Ensures that the tile manager does not attempt to reuse tiles when partial 1787 // Ensures that the tile manager does not attempt to reuse tiles when partial
1804 // raster is disabled. 1788 // raster is disabled.
1805 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) { 1789 TEST_F(TileManagerTest, PartialRasterSuccessfullyDisabled) {
1806 RunPartialRasterCheck(host_impl_.Pass(), false /* partial_raster_enabled */); 1790 RunPartialRasterCheck(host_impl_.Pass(), false /* partial_raster_enabled */);
1807 } 1791 }
1808 1792
1809 } // namespace 1793 } // namespace
1810 } // namespace cc 1794 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698