Index: cc/trees/single_thread_proxy.cc |
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc |
index dcd4cf679b74500ee3ad7fa901d675f6700de710..ba3f2b954fb81302d970552ac04813251bb01d8e 100644 |
--- a/cc/trees/single_thread_proxy.cc |
+++ b/cc/trees/single_thread_proxy.cc |
@@ -147,11 +147,7 @@ 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() |
- .MainThreadCapabilities(); |
- } else if (offscreen_context_provider.get()) { |
+ if (!initialized && offscreen_context_provider.get()) { |
offscreen_context_provider->VerifyContexts(); |
offscreen_context_provider = NULL; |
} |
@@ -166,6 +162,10 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() { |
void SingleThreadProxy::OnOutputSurfaceInitializeAttempted(bool success) { |
danakj
2014/02/14 19:38:50
The "main vs impl" side stuff in here is kinda mes
boliu
2014/02/14 22:03:08
1) it is. Done
|
LayerTreeHost::CreateResult result = |
layer_tree_host_->OnCreateAndInitializeOutputSurfaceAttempted(success); |
+ if (success) { |
danakj
2014/02/14 19:38:50
nit: no {}
boliu
2014/02/14 22:03:08
Done.
|
+ UpdateRendererCapabilitiesOnImplThread(); |
+ } |
+ |
if (result == LayerTreeHost::CreateFailedButTryAgain) { |
// Force another recreation attempt to happen by requesting another commit. |
SetNeedsCommit(); |
@@ -370,6 +370,12 @@ void SingleThreadProxy::SendManagedMemoryStats() { |
bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } |
+void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { |
+ renderer_capabilities_for_main_thread_ = |
+ layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); |
+ layer_tree_host_->RendererCapabilitiesChanged(); |
+} |
+ |
void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { |
TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); |
// Cause a commit so we can notice the lost context. |