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

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: review 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..51709638b5c4b7921e6bc392207de31812c752db 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1327,6 +1327,20 @@ 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.
+ // TODO(boliu): crbug.com/499004 to track removing this.
+ if (!policy.bytes_limit_when_visible && tile_manager_ &&
+ settings_.using_synchronous_renderer_compositor) {
+ ReleaseTreeResources();
+ // TileManager destruction will synchronoulsy wait for all tile workers to
+ // be cancelled or completed. This allows all resources to be freed
+ // synchronously.
+ DestroyTileManager();
+ 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