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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 643993005: Remove limit on number of resources in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2cd7033b4e6abee45001242843777962fdeaa613..bb36807917ae7f2e57a82a498b07ec40079d84f3 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -284,8 +284,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
visible_(true),
cached_managed_memory_policy_(
PrioritizedResourceManager::DefaultMemoryAllocationLimit(),
- gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
- ManagedMemoryPolicy::kDefaultNumResourcesLimit),
+ gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING),
pinch_gesture_active_(false),
pinch_gesture_end_should_clear_scrolling_layer_(false),
fps_counter_(FrameRateCounter::Create(proxy_->HasImplThread())),
@@ -1223,7 +1222,6 @@ void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy(
visible_ ?
policy.priority_cutoff_when_visible :
gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING);
- global_tile_state_.num_resources_limit = policy.num_resources_limit;
// TODO(reveman): We should avoid keeping around unused resources if
// possible. crbug.com/224475
@@ -1240,16 +1238,17 @@ void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy(
// limit after going over.
resource_pool_->SetResourceUsageLimits(
global_tile_state_.soft_memory_limit_in_bytes,
- unused_memory_limit_in_bytes,
- global_tile_state_.num_resources_limit);
+ unused_memory_limit_in_bytes);
// Release all staging resources when invisible.
if (staging_resource_pool_) {
staging_resource_pool_->CheckBusyResources();
- staging_resource_pool_->SetResourceUsageLimits(
- std::numeric_limits<size_t>::max(),
- std::numeric_limits<size_t>::max(),
- visible_ ? GetMaxStagingResourceCount() : 0);
+ size_t bytes_per_tile = settings_.default_tile_size.width() *
+ settings_.default_tile_size.height() *
+ 4; // Conservative 4 bytes per pixel.
+ size_t staging_bytes_limit = bytes_per_tile * GetMaxStagingResourceCount();
+ staging_resource_pool_->SetResourceUsageLimits(staging_bytes_limit,
+ staging_bytes_limit);
reveman 2014/10/27 13:39:00 Where did the visible_ check go? The actual limit
boliu 2014/10/27 15:35:58 Oops my bad! Added back now.
}
DidModifyTilePriorities();

Powered by Google App Engine
This is Rietveld 408576698