Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gl_implementation.h" | 5 #include "ui/gl/gl_implementation.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "ui/gl/gl_version_info.h" | 22 #include "ui/gl/gl_version_info.h" |
| 23 | 23 |
| 24 namespace gl { | 24 namespace gl { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const struct { | 28 const struct { |
| 29 const char* name; | 29 const char* name; |
| 30 GLImplementation implementation; | 30 GLImplementation implementation; |
| 31 } kGLImplementationNamePairs[] = { | 31 } kGLImplementationNamePairs[] = { |
| 32 { kGLImplementationDesktopName, kGLImplementationDesktopGL }, | 32 {kGLImplementationDesktopName, kGLImplementationDesktopGL}, |
| 33 { kGLImplementationOSMesaName, kGLImplementationOSMesaGL }, | 33 {kGLImplementationOSMesaName, kGLImplementationOSMesaGL}, |
| 34 {kGLImplementationSwiftShaderName, kGLImplementationSwiftShaderGL}, | |
| 34 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
| 35 { kGLImplementationAppleName, kGLImplementationAppleGL }, | 36 {kGLImplementationAppleName, kGLImplementationAppleGL}, |
| 36 #endif | 37 #endif |
| 37 { kGLImplementationEGLName, kGLImplementationEGLGLES2 }, | 38 {kGLImplementationEGLName, kGLImplementationEGLGLES2}, |
| 38 { kGLImplementationMockName, kGLImplementationMockGL } | 39 {kGLImplementationMockName, kGLImplementationMockGL}}; |
|
sugoi1
2017/02/10 16:39:37
Note: The whitespace changes are from 'git cl form
| |
| 39 }; | |
| 40 | 40 |
| 41 typedef std::vector<base::NativeLibrary> LibraryArray; | 41 typedef std::vector<base::NativeLibrary> LibraryArray; |
| 42 | 42 |
| 43 GLImplementation g_gl_implementation = kGLImplementationNone; | 43 GLImplementation g_gl_implementation = kGLImplementationNone; |
| 44 LibraryArray* g_libraries; | 44 LibraryArray* g_libraries; |
| 45 GLGetProcAddressProc g_get_proc_address; | 45 GLGetProcAddressProc g_get_proc_address; |
| 46 | 46 |
| 47 void CleanupNativeLibraries(void* unused) { | 47 void CleanupNativeLibraries(void* unused) { |
| 48 if (g_libraries) { | 48 if (g_libraries) { |
| 49 // We do not call base::UnloadNativeLibrary() for these libraries as | 49 // We do not call base::UnloadNativeLibrary() for these libraries as |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); | 239 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); |
| 240 if (!library) { | 240 if (!library) { |
| 241 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " | 241 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " |
| 242 << error.ToString(); | 242 << error.ToString(); |
| 243 return NULL; | 243 return NULL; |
| 244 } | 244 } |
| 245 return library; | 245 return library; |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace gl | 248 } // namespace gl |
| OLD | NEW |