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 56539d110a0be39f2d8541e7f1f3b7ff05023578..cf786120dcc31e542652da81ecd1f88198329838 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1185,6 +1185,10 @@ void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy( |
gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); |
global_tile_state_.num_resources_limit = policy.num_resources_limit; |
+ if (use_gpu_rasterization_ && resource_provider_ && |
+ (!visible_ || global_tile_state_.hard_memory_limit_in_bytes == 0)) |
+ resource_provider_->FreeGrResources(); |
+ |
// TODO(reveman): We should avoid keeping around unused resources if |
// possible. crbug.com/224475 |
// Unused limit is calculated from soft-limit, as hard-limit may |