Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 4fcb8ac6b0afb3a3a1cd41590df5f665b2a5c8a9..4ca7018a5d688f0d8c38918066c8a0a5ccb3f80e 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -1164,8 +1164,7 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
*success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass()); |
- if (offscreen_context_provider.get()) |
- offscreen_context_provider->BindToCurrentThread(); |
+ DidTryInitializeRendererOnImplThread(*success, offscreen_context_provider); |
if (*success) { |
*capabilities = layer_tree_host_impl_->GetRendererCapabilities(); |
@@ -1183,16 +1182,29 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( |
scheduler_on_impl_thread_->SetMaxFramesPending(max_frames_pending); |
- if (layer_tree_host_impl_->resource_provider()) |
+ scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); |
+ } |
+ |
+ completion->Signal(); |
+} |
+ |
+void ThreadProxy::DidTryInitializeRendererOnImplThread( |
+ bool success, |
+ scoped_refptr<ContextProvider> offscreen_context_provider) { |
+ DCHECK(IsImplThread()); |
+ DCHECK(!inside_draw_); |
+ |
+ if (offscreen_context_provider.get()) |
boliu
2013/06/06 19:27:14
Moved everything back to InitializeOutputSurfaceOn
danakj
2013/06/06 19:36:13
You could add a getter to the scheduler to dcheck
|
+ offscreen_context_provider->BindToCurrentThread(); |
+ |
+ if (success) { |
+ 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.get()) { |
offscreen_context_provider->VerifyContexts(); |
} |
- |
- completion->Signal(); |
} |
void ThreadProxy::FinishGLOnImplThread(CompletionEvent* completion) { |