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

Unified Diff: ui/gl/init/gl_initializer_android.cc

Issue 2024953002: Move GL one-off initialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_x11
Patch Set: Fix windows compile. Created 4 years, 7 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: ui/gl/init/gl_initializer_android.cc
diff --git a/ui/gl/init/gl_initializer_android.cc b/ui/gl/init/gl_initializer_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a3c9a270b691027a3a25bb69313fa8af28a12922
--- /dev/null
+++ b/ui/gl/init/gl_initializer_android.cc
@@ -0,0 +1,29 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/init/gl_initializer.h"
+
+#include "base/logging.h"
+#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface_egl.h"
+
+namespace gl {
+namespace init {
+
+// static
+bool GLInitializer::InitializeOneOffPlatform() {
+ switch (GetGLImplementation()) {
+ case kGLImplementationEGLGLES2:
+ if (!GLSurfaceEGL::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
+ return false;
+ }
+ return true;
+ default:
+ return true;
+ }
+}
+
+} // namespace init
+} // namespace gl

Powered by Google App Engine
This is Rietveld 408576698