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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1287043002: cc: Setup API to release OutputSurface from LTHClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test. Created 5 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
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 fa3ba0e599df1d93f2bbd0fdf3c7ce6f33c2a9cd..03441b7363ce474ef961ebdd87773e68ed1eecbe 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2155,10 +2155,7 @@ void LayerTreeHostImpl::CleanUpTileManager() {
single_thread_synchronous_task_graph_runner_ = nullptr;
}
-bool LayerTreeHostImpl::InitializeRenderer(
- scoped_ptr<OutputSurface> output_surface) {
- TRACE_EVENT0("cc", "LayerTreeHostImpl::InitializeRenderer");
-
+scoped_ptr<OutputSurface> LayerTreeHostImpl::ReleaseOutputSurface() {
// Since we will create a new resource provider, we cannot continue to use
danakj 2015/09/17 18:43:55 A trace event in here might be helpful
// the old resources (i.e. render_surfaces and texture IDs). Clear them
// before we destroy the old resource provider.
@@ -2168,8 +2165,15 @@ bool LayerTreeHostImpl::InitializeRenderer(
renderer_ = nullptr;
CleanUpTileManager();
resource_provider_ = nullptr;
- output_surface_ = nullptr;
+ return output_surface_.Pass();
+}
+
+bool LayerTreeHostImpl::InitializeRenderer(
+ scoped_ptr<OutputSurface> output_surface) {
+ TRACE_EVENT0("cc", "LayerTreeHostImpl::InitializeRenderer");
+
+ ReleaseOutputSurface();
if (!output_surface->BindToClient(this)) {
// Avoid recreating tree resources because we might not have enough
// information to do this yet (eg. we don't have a TileManager at this

Powered by Google App Engine
This is Rietveld 408576698