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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2607033002: Flush after ResourcePool deletions complete (Closed)
Patch Set: fix |resource_provider_| check Created 3 years, 11 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/resources/resource_provider.cc ('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 9d01bd653cb692523f0cfccf3bcc9f098ad0f097..fa5b2e6de7f1a37cbc725784539d3677dc06ff06 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1448,8 +1448,10 @@ void LayerTreeHostImpl::ReclaimResources(
const ReturnedResourceArray& resources) {
// TODO(piman): We may need to do some validation on this ack before
// processing it.
- if (resource_provider_)
- resource_provider_->ReceiveReturnsFromParent(resources);
+ if (!resource_provider_)
+ return;
+
+ resource_provider_->ReceiveReturnsFromParent(resources);
// In OOM, we now might be able to release more resources that were held
// because they were exported.
@@ -1472,11 +1474,8 @@ void LayerTreeHostImpl::ReclaimResources(
// If we're not visible, we likely released resources, so we want to
// aggressively flush here to make sure those DeleteTextures make it to the
// GPU process to free up the memory.
- if (compositor_frame_sink_->context_provider() && !visible_) {
- compositor_frame_sink_->context_provider()
- ->ContextGL()
- ->ShallowFlushCHROMIUM();
- }
+ if (!visible_)
+ resource_provider_->FlushPendingDeletions();
}
void LayerTreeHostImpl::OnDraw(const gfx::Transform& transform,
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698