Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / child / npapi / plugin_host.cc
index 4f97f93..f393c7e 100644 (file)
@@ -61,10 +61,15 @@ static bool SupportsCoreAnimationPlugins() {
     return false;
   // We also need to be running with desktop GL and not the software
   // OSMesa renderer in order to share accelerated surfaces between
-  // processes.
-  gfx::GLImplementation implementation = gfx::GetGLImplementation();
+  // processes. Because on MacOS we lazy-initialize GLSurface in the
+  // renderer process here, ensure we're not also initializing GL somewhere
+  // else, and that we only do this once.
+  static gfx::GLImplementation implementation = gfx::kGLImplementationNone;
   if (implementation == gfx::kGLImplementationNone) {
     // Not initialized yet.
+    DCHECK_EQ(implementation, gfx::GetGLImplementation())
+        << "GL already initialized by someone else to: "
+        << gfx::GetGLImplementation();
     if (!gfx::GLSurface::InitializeOneOff()) {
       return false;
     }