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

Unified Diff: content/browser/browser_main_loop.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 Created 6 years, 11 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
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index cc8e6c562f89a52d22fbb499dbd434715fa6fc41..a4c3b722cc7074dda0cd17e730bb626c720213f6 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -70,6 +70,7 @@
#include "base/android/jni_android.h"
#include "content/browser/android/browser_startup_controller.h"
#include "content/browser/android/surface_texture_peer_browser_impl.h"
+#include "ui/gl/gl_surface.h"
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS)
@@ -947,6 +948,13 @@ int BrowserMainLoop::BrowserThreadsStarted() {
#if !defined(OS_IOS)
HistogramSynchronizer::GetInstance();
+#if defined(OS_ANDROID)
+ // On Android, GLSurface::InitializeOneOff() must be called before initalizing
+ // the GpuDataManagerImpl as it uses the GL bindings. crbug.com/326295
+ if (!gfx::GLSurface::InitializeOneOff())
+ LOG(FATAL) << "GLSurface::InitializeOneOff failed";
+#endif
+
// Initialize the GpuDataManager before we set up the MessageLoops because
// otherwise we'll trigger the assertion about doing IO on the UI thread.
GpuDataManagerImpl::GetInstance()->Initialize();

Powered by Google App Engine
This is Rietveld 408576698