Index: cc/trees/single_thread_proxy.cc |
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc |
index 7fe1f565106808b68952ba9866a608188f381b81..001b93639515f2ad2d9d81de61e596e5c9a039cf 100644 |
--- a/cc/trees/single_thread_proxy.cc |
+++ b/cc/trees/single_thread_proxy.cc |
@@ -26,6 +26,7 @@ SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host) |
: Proxy(scoped_ptr<Thread>(NULL)), |
layer_tree_host_(layer_tree_host), |
created_offscreen_context_provider_(false), |
+ initializing_new_output_surface_(false), |
next_frame_is_newly_committed_frame_(false), |
inside_draw_(false) { |
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); |
@@ -138,20 +139,33 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() { |
DCHECK(output_surface); |
initialized = layer_tree_host_impl_->InitializeRenderer( |
output_surface.Pass()); |
- if (initialized) { |
- renderer_capabilities_for_main_thread_ = |
- layer_tree_host_impl_->GetRendererCapabilities(); |
- |
- layer_tree_host_impl_->resource_provider()-> |
- set_offscreen_context_provider(offscreen_context_provider); |
- } else if (offscreen_context_provider) { |
- offscreen_context_provider->VerifyContexts(); |
- } |
+ initializing_new_output_surface_ = true; |
danakj
2013/05/24 19:02:30
You can use base::AutoReset<bool> for a bit more c
|
+ DidUpdateCapabilitiesOnImplThread(initialized, offscreen_context_provider); |
+ initializing_new_output_surface_ = false; |
} |
OnOutputSurfaceInitializeAttempted(initialized); |
} |
+void SingleThreadProxy::DidUpdateCapabilitiesOnImplThread( |
+ bool success, |
+ scoped_refptr<ContextProvider> offscreen_context_provider) { |
+ if (success) { |
+ renderer_capabilities_for_main_thread_ = |
+ layer_tree_host_impl_->GetRendererCapabilities(); |
+ |
+ layer_tree_host_impl_->resource_provider()-> |
+ set_offscreen_context_provider(offscreen_context_provider); |
+ |
+ if (!initializing_new_output_surface_) { |
+ DebugScopedSetMainThread main(this); |
+ layer_tree_host_->DidUpdateCapabilities(); |
+ } |
+ } else if (offscreen_context_provider) { |
+ offscreen_context_provider->VerifyContexts(); |
+ } |
+} |
+ |
void SingleThreadProxy::OnOutputSurfaceInitializeAttempted(bool success) { |
LayerTreeHost::CreateResult result = |
layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success); |