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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2358593002: Flush contexts after LayerTreeHostImpl cleanup (Closed)
Patch Set: Created 4 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 | « 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 ef7181ed753a77543c158a777ea00aa57283d00b..fce0b7982d0207ca0f0cdc3b77e978f7f6b8be96 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2252,6 +2252,19 @@ void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
tile_task_manager_ = nullptr;
single_thread_synchronous_task_graph_runner_ = nullptr;
image_decode_controller_ = nullptr;
+
+ // We've potentially just freed a large number of resources on our various
+ // contexts. Flushing now helps ensure these are cleaned up quickly
+ // preventing driver cache growth. See crbug.com/643251
+ if (compositor_frame_sink_) {
+ if (auto* compositor_context = compositor_frame_sink_->context_provider())
+ compositor_context->ContextGL()->ShallowFlushCHROMIUM();
+ if (auto* worker_context =
+ compositor_frame_sink_->worker_context_provider()) {
+ ContextProvider::ScopedContextLock hold(worker_context);
+ worker_context->ContextGL()->ShallowFlushCHROMIUM();
+ }
+ }
}
void LayerTreeHostImpl::ReleaseCompositorFrameSink() {
« 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