summaryrefslogtreecommitdiffstats
path: root/blimp
diff options
context:
space:
mode:
authorbsalomon <bsalomon@google.com>2016-03-21 14:21:12 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-21 21:22:22 +0000
commit4b02c26d9d1b2b1a22d9257bded03f0d03a7a898 (patch)
treea93f8e34b2434a0964e71a237f2b95785018e8a8 /blimp
parent6108f2e839b14fea7583b501d7e3e1addfc6af8a (diff)
downloadchromium_src-4b02c26d9d1b2b1a22d9257bded03f0d03a7a898.zip
chromium_src-4b02c26d9d1b2b1a22d9257bded03f0d03a7a898.tar.gz
chromium_src-4b02c26d9d1b2b1a22d9257bded03f0d03a7a898.tar.bz2
Bind GrContext to GLES2Interface rather than C GLES interface
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel BUG=442811 Review URL: https://codereview.chromium.org/1671283002 Cr-Commit-Position: refs/heads/master@{#382393}
Diffstat (limited to 'blimp')
-rw-r--r--blimp/client/feature/compositor/blimp_context_provider.cc33
1 files changed, 1 insertions, 32 deletions
diff --git a/blimp/client/feature/compositor/blimp_context_provider.cc b/blimp/client/feature/compositor/blimp_context_provider.cc
index 815a450..a0b22e7 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())));