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

Unified Diff: content/child/npapi/plugin_host.cc

Issue 131433004: Don't initialize GL again in AcceleratedSurface::Initialize() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: macgl: Created 6 years, 10 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 | « no previous file | gpu/config/gpu_info_collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | gpu/config/gpu_info_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698