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

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: review 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 5e89bbeda7ebed65b7fb2dde7c04b8d84c2f968a..c742fe9ee50b4f02e1727963ea016a12eb0108a3 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -162,7 +162,7 @@ unsigned GetMapImageTextureTarget(
size_t GetMaxStagingResourceCount() {
// Upper bound for number of staging resource to allow.
- return 32;
+ return 32 * 512 * 512 * 4;
}
} // namespace
@@ -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())),
@@ -1229,7 +1228,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
@@ -1246,16 +1244,14 @@ 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 staging_bytes_limit = visible_ ? GetMaxStagingResourceCount() : 0u;
+ staging_resource_pool_->SetResourceUsageLimits(staging_bytes_limit,
+ staging_bytes_limit);
}
DidModifyTilePriorities();

Powered by Google App Engine
This is Rietveld 408576698