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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1176713002: Synchronously drop tile textures in android webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove extra if Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa8c22011a956aa42425af3584f333fbd3a5bb0f..e350764ed66b0287be3c827ca32a12971f15555d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1327,6 +1327,17 @@ void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) {
void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
SetManagedMemoryPolicy(policy);
+
+ // This is short term solution to synchronously drop tile resources when
+ // using synchronous compositing to avoid memory usage regression.
+ // crbug.com/499004 to track removing this.
+ if (!policy.bytes_limit_when_visible && tile_manager_ &&
+ settings_.using_synchronous_renderer_compositor) {
+ ReleaseTreeResources();
+ DestroyTileManager();
vmpstr 2015/06/10 23:15:54 Can you make a comment that explains that destruct
boliu 2015/06/10 23:20:56 Done
+ CreateAndSetTileManager();
+ RecreateTreeResources();
+ }
}
void LayerTreeHostImpl::SetTreeActivationCallback(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698