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 9ccbe70b30a7ba37a4d6689d76d350894a74ab8d..be0c98de2dcd91aa9a8e1f93b80249e7b08499ab 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1422,7 +1422,15 @@ bool LayerTreeHostImpl::InitializeRenderer( |
| if (!output_surface->BindToClient(this)) |
| return false; |
| - if (output_surface->capabilities().deferred_gl_initialization) { |
| + return DoInitializeRenderer(output_surface.Pass(), |
| + false /* is_deffered_init */); |
| +} |
| + |
| +bool LayerTreeHostImpl::DoInitializeRenderer( |
| + scoped_ptr<OutputSurface> output_surface, |
| + bool is_deffered_init) { |
| + if (output_surface->capabilities().deferred_gl_initialization && |
| + !is_deffered_init) { |
| // TODO(joth): Defer creating the Renderer too, until GL is initialized. |
| // See http://crbug.com/230197 |
| renderer_ = SoftwareRenderer::Create(this, output_surface.get(), NULL); |
|
piman
2013/05/28 23:35:34
I wasn't involved in the original CL, but like Dan
|
| @@ -1479,6 +1487,17 @@ bool LayerTreeHostImpl::InitializeRenderer( |
| return true; |
| } |
| +bool LayerTreeHostImpl::InitializeForGL( |
| + scoped_refptr<ContextProvider> offscreen_context_provider) { |
| + DCHECK(output_surface_->capabilities().deferred_gl_initialization); |
| + DCHECK(output_surface_->context3d()); |
| + bool success = |
| + DoInitializeRenderer(output_surface_.Pass(), true /* is_deffered_init */); |
| + client_->DidTryInitializeRendererOnImplThread(success, |
| + offscreen_context_provider); |
| + return success; |
| +} |
| + |
| void LayerTreeHostImpl::SetViewportSize(gfx::Size device_viewport_size) { |
| if (device_viewport_size == device_viewport_size_) |
| return; |