| 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" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 base::ThreadRestrictions::ScopedAllowIO allow_io; | 167 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 168 | 168 |
| 169 switch (implementation) { | 169 switch (implementation) { |
| 170 case kGLImplementationOSMesaGL: | 170 case kGLImplementationOSMesaGL: |
| 171 return InitializeStaticGLBindingsOSMesaGL(); | 171 return InitializeStaticGLBindingsOSMesaGL(); |
| 172 case kGLImplementationDesktopGL: | 172 case kGLImplementationDesktopGL: |
| 173 return InitializeStaticGLXInternal(); | 173 return InitializeStaticGLXInternal(); |
| 174 case kGLImplementationEGLGLES2: | 174 case kGLImplementationEGLGLES2: |
| 175 return InitializeStaticEGLInternal(); | 175 return InitializeStaticEGLInternal(); |
| 176 case kGLImplementationMockGL: | 176 case kGLImplementationMockGL: |
| 177 SetGLImplementation(kGLImplementationMockGL); | 177 case kGLImplementationStubGL: |
| 178 SetGLImplementation(implementation); |
| 178 InitializeStaticGLBindingsGL(); | 179 InitializeStaticGLBindingsGL(); |
| 179 return true; | 180 return true; |
| 180 default: | 181 default: |
| 181 NOTREACHED(); | 182 NOTREACHED(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 return false; | 185 return false; |
| 185 } | 186 } |
| 186 | 187 |
| 187 void InitializeDebugGLBindings() { | 188 void InitializeDebugGLBindings() { |
| 188 InitializeDebugGLBindingsEGL(); | 189 InitializeDebugGLBindingsEGL(); |
| 189 InitializeDebugGLBindingsGL(); | 190 InitializeDebugGLBindingsGL(); |
| 190 InitializeDebugGLBindingsGLX(); | 191 InitializeDebugGLBindingsGLX(); |
| 191 InitializeDebugGLBindingsOSMESA(); | 192 InitializeDebugGLBindingsOSMESA(); |
| 192 } | 193 } |
| 193 | 194 |
| 194 void ShutdownGLPlatform() { | 195 void ShutdownGLPlatform() { |
| 195 GLSurfaceEGL::ShutdownOneOff(); | 196 GLSurfaceEGL::ShutdownOneOff(); |
| 196 ClearBindingsEGL(); | 197 ClearBindingsEGL(); |
| 197 ClearBindingsGL(); | 198 ClearBindingsGL(); |
| 198 ClearBindingsGLX(); | 199 ClearBindingsGLX(); |
| 199 ClearBindingsOSMESA(); | 200 ClearBindingsOSMESA(); |
| 200 } | 201 } |
| 201 | 202 |
| 202 } // namespace init | 203 } // namespace init |
| 203 } // namespace gl | 204 } // namespace gl |
| OLD | NEW |