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

Unified Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 143023005: Support multiple service instances with GLInProcessContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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: 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;

Powered by Google App Engine
This is Rietveld 408576698