summaryrefslogtreecommitdiffstats
path: root/android_webview
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 /android_webview
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 'android_webview')
-rw-r--r--android_webview/browser/aw_render_thread_context_provider.cc35
1 files changed, 1 insertions, 34 deletions
diff --git a/android_webview/browser/aw_render_thread_context_provider.cc b/android_webview/browser/aw_render_thread_context_provider.cc
index 27dbf714..801cd7f 100644
--- a/android_webview/browser/aw_render_thread_context_provider.cc
+++ b/android_webview/browser/aw_render_thread_context_provider.cc
@@ -19,24 +19,6 @@
namespace android_webview {
-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;
-
-} // namespace
-
// static
scoped_refptr<AwRenderThreadContextProvider>
AwRenderThreadContextProvider::Create(
@@ -111,29 +93,14 @@ gpu::ContextSupport* AwRenderThreadContextProvider::ContextSupport() {
return context_->GetImplementation();
}
-static void BindGrContextCallback(const GrGLInterface* interface) {
- cc::ContextProvider* context_provider =
- reinterpret_cast<AwRenderThreadContextProvider*>(
- interface->fCallbackData);
-
- gles2::SetGLContext(context_provider->ContextGL());
-}
-
class GrContext* AwRenderThreadContextProvider::GrContext() {
DCHECK(main_thread_checker_.CalledOnValidThread());
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())));