diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 13:02:14 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 13:02:14 +0000 |
commit | 55de4361ad4085513d80f6b8fcdd5bbd5c5c1a7f (patch) | |
tree | 897ba6ffc5dff21faf792642d5933b0bfb491ad5 /cc | |
parent | 3fdd7b895a52a95723b63781595dd8188cf67beb (diff) | |
download | chromium_src-55de4361ad4085513d80f6b8fcdd5bbd5c5c1a7f.zip chromium_src-55de4361ad4085513d80f6b8fcdd5bbd5c5c1a7f.tar.gz chromium_src-55de4361ad4085513d80f6b8fcdd5bbd5c5c1a7f.tar.bz2 |
cc: Put a limit on number of scheduled raster tasks.
This re-introduces a limit that seems to have been lost. Previously,
it was set to 256. I've changed it to be 32, since that seems to be
a reasonable number for the amount of tiles to process in a frame.
Note that if all tiles are rasterized in one frame, we'll simply
call to tile manager to get more tasks, so this doesn't limit
the amount of work per frame, it just limits the amount of work
per call to ManageTiles().
R=reveman@chromium.org
Review URL: https://codereview.chromium.org/177073008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/resources/tile_manager.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 048b917..50c383f 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -23,6 +23,8 @@ namespace cc { namespace { +const size_t kScheduledRasterTasksLimit = 32u; + // Memory limit policy works by mapping some bin states to the NEVER bin. const ManagedTileBin kBinPolicyMap[NUM_TILE_MEMORY_LIMIT_POLICIES][NUM_BINS] = { // [ALLOW_NOTHING] @@ -732,7 +734,11 @@ void TileManager::AssignGpuMemoryToTiles( // 1. Tile size should not impact raster priority. // 2. Tiles with existing raster task could otherwise incorrectly // be added as they are not affected by |bytes_allocatable|. - if (oomed_soft || raster_bytes_if_rastered > max_raster_bytes) { + bool can_schedule_tile = + !oomed_soft && raster_bytes_if_rastered <= max_raster_bytes && + tiles_that_need_to_be_rasterized->size() < kScheduledRasterTasksLimit; + + if (!can_schedule_tile) { all_tiles_that_need_to_be_rasterized_have_memory_ = false; if (tile->required_for_activation()) all_tiles_required_for_activation_have_memory_ = false; |