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 f81a3b1d74f84ca0fca917b7f1830bb3687af138..8591a6822d966b4b7848cc443c34b60da30f7f1e 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1169,6 +1169,18 @@ void LayerTreeHostImpl::UpdateTileManagerMemoryPolicy( |
gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); |
global_tile_state_.num_resources_limit = policy.num_resources_limit; |
+ if (use_gpu_rasterization_ && |
+ (!visible_ || global_tile_state_.hard_memory_limit_in_bytes == 0)) { |
+ if (rasterizer_) |
+ rasterizer_->ClearCache(); |
+ } |
+ |
+ if (use_gpu_rasterization_ && |
+ (visible_ && global_tile_state_.hard_memory_limit_in_bytes > 0)) { |
+ if (rasterizer_) |
+ rasterizer_->RestoreCacheLimits(); |
+ } |
+ |
// 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 |