diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-11 23:51:29 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-11 23:51:29 +0000 |
commit | 2421f95d69bae09623de1febafb834712de99347 (patch) | |
tree | aa3c90bccc85fc0059250112e09f4734089d2b7c /cc/resources | |
parent | b3643878372403be1f32a4bb12bdd2a6c5f4cb1f (diff) | |
download | chromium_src-2421f95d69bae09623de1febafb834712de99347.zip chromium_src-2421f95d69bae09623de1febafb834712de99347.tar.gz chromium_src-2421f95d69bae09623de1febafb834712de99347.tar.bz2 |
cc: Always use combined_bin when computing GPU memory manager stats.
By only including memory used for pending or active tree in GPU
memory manager stats we often report usage that will cause the
manager to think our requirements are lower than they are.
Always using the combined bin seem to produce better results.
BUG=342261
Review URL: https://codereview.chromium.org/153263005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/tile_manager.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 57f13d0..49258e4 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -408,42 +408,38 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) { // Compute combined bin. ManagedTileBin combined_bin = std::min(active_bin, pending_bin); + if (!tile_is_ready_to_draw || tile_version.requires_resource()) { + // The bin that the tile would have if the GPU memory manager had + // a maximally permissive policy, send to the GPU memory manager + // to determine policy. + ManagedTileBin gpu_memmgr_stats_bin = combined_bin; + if ((gpu_memmgr_stats_bin == NOW_BIN) || + (gpu_memmgr_stats_bin == NOW_AND_READY_TO_DRAW_BIN)) + memory_required_bytes_ += BytesConsumedIfAllocated(tile); + if (gpu_memmgr_stats_bin != NEVER_BIN) + memory_nice_to_have_bytes_ += BytesConsumedIfAllocated(tile); + } + ManagedTileBin tree_bin[NUM_TREES]; tree_bin[ACTIVE_TREE] = kBinPolicyMap[memory_policy][active_bin]; tree_bin[PENDING_TREE] = kBinPolicyMap[memory_policy][pending_bin]; - // The bin that the tile would have if the GPU memory manager had - // a maximally permissive policy, send to the GPU memory manager - // to determine policy. - ManagedTileBin gpu_memmgr_stats_bin = NEVER_BIN; TilePriority tile_priority; - switch (tree_priority) { case SAME_PRIORITY_FOR_BOTH_TREES: mts.bin = kBinPolicyMap[memory_policy][combined_bin]; - gpu_memmgr_stats_bin = combined_bin; tile_priority = tile->combined_priority(); break; case SMOOTHNESS_TAKES_PRIORITY: mts.bin = tree_bin[ACTIVE_TREE]; - gpu_memmgr_stats_bin = active_bin; tile_priority = active_priority; break; case NEW_CONTENT_TAKES_PRIORITY: mts.bin = tree_bin[PENDING_TREE]; - gpu_memmgr_stats_bin = pending_bin; tile_priority = pending_priority; break; } - if (!tile_is_ready_to_draw || tile_version.requires_resource()) { - if ((gpu_memmgr_stats_bin == NOW_BIN) || - (gpu_memmgr_stats_bin == NOW_AND_READY_TO_DRAW_BIN)) - memory_required_bytes_ += BytesConsumedIfAllocated(tile); - if (gpu_memmgr_stats_bin != NEVER_BIN) - memory_nice_to_have_bytes_ += BytesConsumedIfAllocated(tile); - } - // Bump up the priority if we determined it's NEVER_BIN on one tree, // but is still required on the other tree. bool is_in_never_bin_on_both_trees = tree_bin[ACTIVE_TREE] == NEVER_BIN && |