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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2468023002: Don't free non-tile resources on GPU rasterization toggle (Closed)
Patch Set: fix unittest Created 4 years, 1 month 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') | cc/trees/layer_tree_impl.h » ('j') | 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 363e940899c1d80631d68686ea3b83e7ed27c6bb..5dcc1ac9629bcf366566ece1e6b3fe2e66ba9a3f 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1359,7 +1359,7 @@ void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
// TODO(boliu): crbug.com/499004 to track removing this.
if (!policy.bytes_limit_when_visible && resource_pool_ &&
settings_.using_synchronous_renderer_compositor) {
- ReleaseTreeResources();
+ ReleaseTileResources();
CleanUpTileManagerAndUIResources();
// Force a call to NotifyAllTileTasks completed - otherwise this logic may
@@ -1368,7 +1368,7 @@ void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
NotifyAllTileTasksCompleted();
CreateTileManagerResources();
- RecreateTreeResources();
+ RecreateTileResources();
}
}
@@ -1807,12 +1807,12 @@ void LayerTreeHostImpl::UpdateTreeResourcesForGpuRasterizationIfNeeded() {
// appropriate rasterizer. Only do this however if we already have a
// resource pool, since otherwise we might not be able to create a new
// one.
- ReleaseTreeResources();
+ ReleaseTileResources();
if (resource_pool_) {
CleanUpTileManagerAndUIResources();
CreateTileManagerResources();
}
- RecreateTreeResources();
+ RecreateTileResources();
// We have released tilings for both active and pending tree.
// We would not have any content to draw until the pending tree is activated.
@@ -2083,12 +2083,20 @@ void LayerTreeHostImpl::ReleaseTreeResources() {
EvictAllUIResources();
}
-void LayerTreeHostImpl::RecreateTreeResources() {
- active_tree_->RecreateResources();
+void LayerTreeHostImpl::ReleaseTileResources() {
+ active_tree_->ReleaseTileResources();
+ if (pending_tree_)
+ pending_tree_->ReleaseTileResources();
+ if (recycle_tree_)
+ recycle_tree_->ReleaseTileResources();
+}
+
+void LayerTreeHostImpl::RecreateTileResources() {
+ active_tree_->RecreateTileResources();
if (pending_tree_)
- pending_tree_->RecreateResources();
+ pending_tree_->RecreateTileResources();
if (recycle_tree_)
- recycle_tree_->RecreateResources();
+ recycle_tree_->RecreateTileResources();
}
void LayerTreeHostImpl::CreateTileManagerResources() {
@@ -2332,7 +2340,7 @@ bool LayerTreeHostImpl::InitializeRenderer(
pending_tree_->set_needs_update_draw_properties();
CreateTileManagerResources();
- RecreateTreeResources();
+ RecreateTileResources();
client_->OnCanDrawStateChanged(CanDraw());
SetFullViewportDamage();
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698