| Index: content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| index 7613168adfd70901b16776a56a58c042b8d6bdaf..4ca89a90ec5d8aa77b096c720d40633576366f7c 100644
|
| --- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| @@ -17,6 +17,7 @@
|
| #include "content/public/browser/android/synchronous_compositor_client.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/common/content_switches.h"
|
| +#include "content/renderer/android/synchronous_compositor_factory.h"
|
| #include "skia/ext/refptr.h"
|
| #include "third_party/skia/include/core/SkCanvas.h"
|
| #include "third_party/skia/include/core/SkDevice.h"
|
| @@ -92,6 +93,12 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
|
| capabilities_.deferred_gl_initialization = true;
|
| // Cannot call out to GetDelegate() here as the output surface is not
|
| // constructed on the correct thread.
|
| +
|
| + SynchronousCompositorFactory* factory =
|
| + SynchronousCompositorFactory::GetInstance();
|
| + DCHECK(factory);
|
| + context_provider_for_compositor_thread_ =
|
| + factory->GetOffscreenContextProviderForCompositorThread();
|
| }
|
|
|
| SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
|
| @@ -153,9 +160,11 @@ bool SynchronousCompositorOutputSurface::InitializeHwDraw() {
|
| DCHECK(client_);
|
| DCHECK(!context3d_);
|
|
|
| - // TODO(boliu): Get a context provider in constructor and pass here.
|
| + scoped_refptr<cc::ContextProvider> provider;
|
| + provider.swap(context_provider_for_compositor_thread_);
|
| +
|
| return InitializeAndSetContext3D(CreateWebGraphicsContext3D().Pass(),
|
| - scoped_refptr<cc::ContextProvider>());
|
| + provider);
|
| }
|
|
|
| bool SynchronousCompositorOutputSurface::DemandDrawHw(
|
|
|