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

Unified Diff: cc/trees/thread_proxy.cc

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile by including ContextProvider from output_surface_client.h Created 7 years, 6 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 4fcb8ac6b0afb3a3a1cd41590df5f665b2a5c8a9..d1c44712c33643e15e009eb7b28497b470949676 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -1164,9 +1164,6 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
*success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass());
- if (offscreen_context_provider.get())
- offscreen_context_provider->BindToCurrentThread();
-
if (*success) {
*capabilities = layer_tree_host_impl_->GetRendererCapabilities();
scheduler_on_impl_thread_->SetSwapBuffersCompleteSupported(
@@ -1183,16 +1180,34 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
scheduler_on_impl_thread_->SetMaxFramesPending(max_frames_pending);
- if (layer_tree_host_impl_->resource_provider())
+ scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
+ }
+
+ DidTryInitializeRendererOnImplThread(*success, offscreen_context_provider);
+
+ completion->Signal();
+}
+
+void ThreadProxy::DidTryInitializeRendererOnImplThread(
+ bool success,
+ scoped_refptr<ContextProvider> offscreen_context_provider) {
+ DCHECK(IsImplThread());
+ DCHECK(!inside_draw_);
+
+ if (offscreen_context_provider.get())
+ offscreen_context_provider->BindToCurrentThread();
+
+ if (success) {
+ DCHECK_EQ(layer_tree_host_impl_->GetRendererCapabilities()
+ .using_swap_complete_callback,
+ scheduler_on_impl_thread_->swap_buffers_complete_supported());
+ 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) {
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698