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

Unified Diff: cc/trees/thread_proxy.cc

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanups Created 7 years, 7 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
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) {

Powered by Google App Engine
This is Rietveld 408576698