Chromium Code Reviews| 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 |