Index: content/browser/compositor/gpu_process_transport_factory.cc |
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc |
index 0e1025c495b1e84afe88949146c2a5de960d06a6..25f9dad4e565ae2ab2a67a9b07bdf6cac6780165 100644 |
--- a/content/browser/compositor/gpu_process_transport_factory.cc |
+++ b/content/browser/compositor/gpu_process_transport_factory.cc |
@@ -160,6 +160,18 @@ scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface( |
UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); |
+ if (context_provider) { |
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = |
+ GetCompositorMessageLoop(); |
+ if (!compositor_thread_task_runner.get()) |
+ compositor_thread_task_runner = base::MessageLoopProxy::current(); |
+ |
+ // Here we know the GpuProcessHost has been set up, because we created a |
+ // context. |
+ output_surface_proxy_->ConnectToGpuProcessHost( |
+ compositor_thread_task_runner.get()); |
+ } |
+ |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kUseSurfaces)) { |
// This gets a bit confusing. Here we have a ContextProvider configured to |
@@ -213,16 +225,6 @@ scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface( |
return surface.PassAs<cc::OutputSurface>(); |
} |
- scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = |
- GetCompositorMessageLoop(); |
- if (!compositor_thread_task_runner.get()) |
- compositor_thread_task_runner = base::MessageLoopProxy::current(); |
- |
- // Here we know the GpuProcessHost has been set up, because we created a |
- // context. |
- output_surface_proxy_->ConnectToGpuProcessHost( |
- compositor_thread_task_runner.get()); |
- |
scoped_ptr<BrowserCompositorOutputSurface> surface( |
new GpuBrowserCompositorOutputSurface( |
context_provider, |