| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/init/gl_initializer.h" | 5 #include "ui/gl/init/gl_initializer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "ui/gfx/x/x11_types.h" |
| 12 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
| 13 #include "ui/gl/gl_egl_api_implementation.h" | 14 #include "ui/gl/gl_egl_api_implementation.h" |
| 14 #include "ui/gl/gl_gl_api_implementation.h" | 15 #include "ui/gl/gl_gl_api_implementation.h" |
| 15 #include "ui/gl/gl_glx_api_implementation.h" | 16 #include "ui/gl/gl_glx_api_implementation.h" |
| 16 #include "ui/gl/gl_implementation_osmesa.h" | 17 #include "ui/gl/gl_implementation_osmesa.h" |
| 17 #include "ui/gl/gl_osmesa_api_implementation.h" | 18 #include "ui/gl/gl_osmesa_api_implementation.h" |
| 18 #include "ui/gl/gl_surface_egl.h" | 19 #include "ui/gl/gl_surface_egl.h" |
| 19 #include "ui/gl/gl_surface_glx.h" | 20 #include "ui/gl/gl_surface_glx.h" |
| 20 #include "ui/gl/gl_surface_osmesa_x11.h" | 21 #include "ui/gl/gl_surface_osmesa_x11.h" |
| 21 #include "ui/gl/gl_switches.h" | 22 #include "ui/gl/gl_switches.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return false; | 131 return false; |
| 131 } | 132 } |
| 132 return true; | 133 return true; |
| 133 case kGLImplementationOSMesaGL: | 134 case kGLImplementationOSMesaGL: |
| 134 if (!GLSurfaceOSMesaX11::InitializeOneOff()) { | 135 if (!GLSurfaceOSMesaX11::InitializeOneOff()) { |
| 135 LOG(ERROR) << "GLSurfaceOSMesaX11::InitializeOneOff failed."; | 136 LOG(ERROR) << "GLSurfaceOSMesaX11::InitializeOneOff failed."; |
| 136 return false; | 137 return false; |
| 137 } | 138 } |
| 138 return true; | 139 return true; |
| 139 case kGLImplementationEGLGLES2: | 140 case kGLImplementationEGLGLES2: |
| 141 GLSurfaceEGL::SetNativeDisplay(gfx::GetXDisplay()); |
| 140 if (!GLSurfaceEGL::InitializeOneOff()) { | 142 if (!GLSurfaceEGL::InitializeOneOff()) { |
| 141 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; | 143 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
| 142 return false; | 144 return false; |
| 143 } | 145 } |
| 144 return true; | 146 return true; |
| 145 default: | 147 default: |
| 146 return true; | 148 return true; |
| 147 } | 149 } |
| 148 } | 150 } |
| 149 | 151 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 188 |
| 187 void ClearGLBindingsPlatform() { | 189 void ClearGLBindingsPlatform() { |
| 188 ClearGLBindingsEGL(); | 190 ClearGLBindingsEGL(); |
| 189 ClearGLBindingsGL(); | 191 ClearGLBindingsGL(); |
| 190 ClearGLBindingsGLX(); | 192 ClearGLBindingsGLX(); |
| 191 ClearGLBindingsOSMESA(); | 193 ClearGLBindingsOSMESA(); |
| 192 } | 194 } |
| 193 | 195 |
| 194 } // namespace init | 196 } // namespace init |
| 195 } // namespace gl | 197 } // namespace gl |
| OLD | NEW |