Index: ui/gl/init/gl_initializer_x11.cc |
diff --git a/ui/gl/init/gl_initializer_x11.cc b/ui/gl/init/gl_initializer_x11.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e3f696db92f68a0292a264a40808a35384eb9a2 |
--- /dev/null |
+++ b/ui/gl/init/gl_initializer_x11.cc |
@@ -0,0 +1,43 @@ |
+// 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" |
+#include "ui/gl/gl_surface_glx.h" |
+#include "ui/gl/gl_surface_osmesa_x11.h" |
+ |
+namespace gl { |
+namespace init { |
+ |
+// static |
+bool GLInitializer::InitializeOneOffPlatform() { |
+ switch (GetGLImplementation()) { |
+ case kGLImplementationDesktopGL: |
+ if (!GLSurfaceGLX::InitializeOneOff()) { |
+ LOG(ERROR) << "GLSurfaceGLX::InitializeOneOff failed."; |
+ return false; |
+ } |
+ return true; |
+ case kGLImplementationOSMesaGL: |
+ if (!GLSurfaceOSMesaX11::InitializeOneOff()) { |
+ LOG(ERROR) << "GLSurfaceOSMesaX11::InitializeOneOff failed."; |
+ return false; |
+ } |
+ return true; |
+ case kGLImplementationEGLGLES2: |
+ if (!GLSurfaceEGL::InitializeOneOff()) { |
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
+ return false; |
+ } |
+ return true; |
+ default: |
+ return true; |
+ } |
+} |
+ |
+} // namespace init |
+} // namespace gl |