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

Unified Diff: content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc

Issue 1671283002: Bind GrContext to GLES2Interface rather than C GLES interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix dependency in gyp and gn? Created 4 years, 9 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
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | gpu/skia_bindings/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc
diff --git a/content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc b/content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc
index 5cd4944db68ed071ebbfd9efee8ca6da08f02562..905090e86d63db8eec5daae12a62e73a698e6867 100644
--- a/content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc
+++ b/content/common/gpu/client/grcontext_for_webgraphicscontext3d.cc
@@ -20,41 +20,13 @@ using gpu_blink::WebGraphicsContext3DImpl;
namespace content {
-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;
-
-void BindWebGraphicsContext3DGLContextCallback(const GrGLInterface* interface) {
- gles2::SetGLContext(static_cast<const GrGLInterfaceForWebGraphicsContext3D*>(
- interface)->WebContext3D()->GetGLInterface());
-}
-
-} // namespace anonymous
-
GrContextForWebGraphicsContext3D::GrContextForWebGraphicsContext3D(
skia::RefPtr<GrGLInterfaceForWebGraphicsContext3D> gr_interface) {
if (!gr_interface || !gr_interface->WebContext3D())
return;
- // Ensure the gles2 library is initialized first in a thread safe way.
- g_gles2_initializer.Get();
- gles2::SetGLContext(gr_interface->WebContext3D()->GetGLInterface());
-
- skia_bindings::InitCommandBufferSkiaGLBinding(gr_interface.get());
-
- gr_interface->fCallback = BindWebGraphicsContext3DGLContextCallback;
+ skia_bindings::InitGLES2InterfaceBindings(
+ gr_interface.get(), gr_interface->WebContext3D()->GetGLInterface());
gr_context_ = skia::AdoptRef(GrContext::Create(
kOpenGL_GrBackend,
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | gpu/skia_bindings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698