| Index: blimp/client/feature/compositor/blimp_context_provider.cc
|
| diff --git a/blimp/client/feature/compositor/blimp_context_provider.cc b/blimp/client/feature/compositor/blimp_context_provider.cc
|
| index 815a4501e38f8157f151834d92336e99b717700a..a0b22e7ed16534eee36b86a7cdac20c5bdbe5cb2 100644
|
| --- a/blimp/client/feature/compositor/blimp_context_provider.cc
|
| +++ b/blimp/client/feature/compositor/blimp_context_provider.cc
|
| @@ -16,30 +16,6 @@
|
|
|
| namespace blimp {
|
| namespace client {
|
| -namespace {
|
| -
|
| -// Singleton used to initialize and terminate the gles2 library.
|
| -class GLES2Initializer {
|
| - public:
|
| - GLES2Initializer() { gles2::Initialize(); }
|
| -
|
| - ~GLES2Initializer() { gles2::Terminate(); }
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(GLES2Initializer);
|
| -};
|
| -
|
| -base::LazyInstance<GLES2Initializer> g_gles2_initializer =
|
| - LAZY_INSTANCE_INITIALIZER;
|
| -
|
| -static void BindGrContextCallback(const GrGLInterface* interface) {
|
| - BlimpContextProvider* context_provider =
|
| - reinterpret_cast<BlimpContextProvider*>(interface->fCallbackData);
|
| -
|
| - gles2::SetGLContext(context_provider->ContextGL());
|
| -}
|
| -
|
| -} // namespace
|
|
|
| // static
|
| scoped_refptr<BlimpContextProvider> BlimpContextProvider::Create(
|
| @@ -111,15 +87,8 @@ class GrContext* BlimpContextProvider::GrContext() {
|
| if (gr_context_)
|
| return gr_context_.get();
|
|
|
| - // The GrGLInterface factory will make GL calls using the C GLES2 interface.
|
| - // Make sure the gles2 library is initialized first on exactly one thread.
|
| - g_gles2_initializer.Get();
|
| - gles2::SetGLContext(ContextGL());
|
| -
|
| skia::RefPtr<GrGLInterface> interface = skia::AdoptRef(new GrGLInterface);
|
| - skia_bindings::InitCommandBufferSkiaGLBinding(interface.get());
|
| - interface->fCallback = BindGrContextCallback;
|
| - interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this);
|
| + skia_bindings::InitGLES2InterfaceBindings(interface.get(), ContextGL());
|
|
|
| gr_context_ = skia::AdoptRef(GrContext::Create(
|
| kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get())));
|
|
|