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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 23475021: [cc] Consolidate UI resource destruction and recreation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « cc/trees/layer_tree_host_impl.h ('k') | 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 870b65d89ba7b123085028c34359d4afbf122131..03d35893936dcdc64e51266601b8393b071e6e43 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1563,8 +1563,7 @@ void LayerTreeHostImpl::ReleaseTreeResources() {
if (recycle_tree_ && recycle_tree_->root_layer())
SendReleaseResourcesRecursive(recycle_tree_->root_layer());
- // Remove all existing maps from UIResourceId to ResourceId.
- ui_resource_map_.clear();
+ DeleteAllUIResources();
}
void LayerTreeHostImpl::CreateAndSetRenderer(
@@ -2575,6 +2574,15 @@ void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) {
}
}
+void LayerTreeHostImpl::DeleteAllUIResources() {
+ for (UIResourceMap::const_iterator iter = ui_resource_map_.begin();
+ iter != ui_resource_map_.end();
+ ++iter) {
+ resource_provider_->DeleteResource(iter->second);
+ }
+ ui_resource_map_.clear();
+}
+
ResourceProvider::ResourceId LayerTreeHostImpl::ResourceIdForUIResource(
UIResourceId uid) const {
UIResourceMap::const_iterator iter = ui_resource_map_.find(uid);
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698