Chromium Code Reviews| Index: cc/trees/thread_proxy.cc |
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
| index c807427b348fbaebf51694a0c5a062824b07a72e..c1ea816c3dadc38cd95a5dd5193fba68b8925ee4 100644 |
| --- a/cc/trees/thread_proxy.cc |
| +++ b/cc/trees/thread_proxy.cc |
| @@ -1162,13 +1162,29 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
| *success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); |
| - if (offscreen_context_provider) |
| - offscreen_context_provider->BindToCurrentThread(); |
| + DidTryInitializeRendererOnImplThread(*success, offscreen_context_provider); |
| if (*success) { |
| *capabilities = layer_tree_host_impl_->GetRendererCapabilities(); |
| + scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); |
|
aelias_OOO_until_Jul13
2013/05/30 06:42:44
This scheduler change looks to be the other loose
boliu
2013/05/30 16:24:34
I didn't think this as a problem. As far as the sc
|
| + } |
| + |
| + completion->Signal(); |
| +} |
| + |
| +void ThreadProxy::DidTryInitializeRendererOnImplThread( |
| + bool success, |
| + scoped_refptr<ContextProvider> offscreen_context_provider) { |
| + DCHECK(IsImplThread()); |
| + |
| + if (offscreen_context_provider) |
| + offscreen_context_provider->BindToCurrentThread(); |
| + |
| + if (success) { |
| + RendererCapabilities capabilities = |
| + layer_tree_host_impl_->GetRendererCapabilities(); |
| scheduler_on_impl_thread_->SetSwapBuffersCompleteSupported( |
| - capabilities->using_swap_complete_callback); |
| + capabilities.using_swap_complete_callback); |
| OutputSurface* output_surface_ptr = layer_tree_host_impl_->output_surface(); |
| DCHECK(output_surface_ptr); |
| @@ -1181,16 +1197,13 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
| scheduler_on_impl_thread_->SetMaxFramesPending(max_frames_pending); |
| - if (layer_tree_host_impl_->resource_provider()) |
| + if (layer_tree_host_impl_->resource_provider()) { |
| layer_tree_host_impl_->resource_provider()-> |
| set_offscreen_context_provider(offscreen_context_provider); |
| - |
| - scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); |
| + } |
| } else if (offscreen_context_provider) { |
| offscreen_context_provider->VerifyContexts(); |
| } |
| - |
| - completion->Signal(); |
| } |
| void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) { |