Index: content/browser/android/in_process/synchronous_compositor_impl.cc |
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc |
index 95289805afaedbf1cb546e0e713e6ad4362f7571..994a1ec552393191d27b1a8cdeb96eb91fe86bc3 100644 |
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc |
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc |
@@ -82,13 +82,27 @@ void SynchronousCompositorImpl::SetClient( |
compositor_client_ = compositor_client; |
} |
+// static |
+void SynchronousCompositor::SetGpuService( |
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { |
+ g_factory.Get().SetDeferredGpuService(service); |
+} |
+ |
bool SynchronousCompositorImpl::InitializeHwDraw( |
scoped_refptr<gfx::GLSurface> surface) { |
DCHECK(CalledOnValidThread()); |
DCHECK(output_surface_); |
- bool success = output_surface_->InitializeHwDraw( |
- surface, |
- g_factory.Get().GetOffscreenContextProviderForCompositorThread()); |
+ |
+ // Create contexts in this order so that the share group gets passed |
+ // along correctly. |
+ scoped_refptr<cc::ContextProvider> offscreen_context = |
+ g_factory.Get().GetOffscreenContextProviderForCompositorThread(); |
+ scoped_refptr<cc::ContextProvider> onscreen_context = |
+ g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); |
+ |
+ bool success = |
+ output_surface_->InitializeHwDraw(onscreen_context, offscreen_context); |
+ |
if (success) |
g_factory.Get().CompositorInitializedHardwareDraw(); |
return success; |