| 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..f1858a80101dd437b82bf223c5843fdf445f40fd 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())),
|
| @@ -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,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);
|
| }
|
|
|
| DidModifyTilePriorities();
|
|
|