Index: content/child/npapi/plugin_host.cc |
diff --git a/content/child/npapi/plugin_host.cc b/content/child/npapi/plugin_host.cc |
index 4f97f9380d444ff128db2b4c80bd1b6e38aaa402..f393c7edb5cbf9b44123c691c7a3fe9707e67aac 100644 |
--- a/content/child/npapi/plugin_host.cc |
+++ b/content/child/npapi/plugin_host.cc |
@@ -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; |
} |