| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_implementation.h" | 5 #include "ui/gfx/gl/gl_implementation.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 void SetGLImplementation(GLImplementation implementation) { | 101 void SetGLImplementation(GLImplementation implementation) { |
| 102 g_gl_implementation = implementation; | 102 g_gl_implementation = implementation; |
| 103 } | 103 } |
| 104 | 104 |
| 105 GLImplementation GetGLImplementation() { | 105 GLImplementation GetGLImplementation() { |
| 106 return g_gl_implementation; | 106 return g_gl_implementation; |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool HasDesktopGLFeatures() { |
| 110 return kGLImplementationDesktopGL == g_gl_implementation || |
| 111 kGLImplementationOSMesaGL == g_gl_implementation; |
| 112 } |
| 113 |
| 109 void AddGLNativeLibrary(base::NativeLibrary library) { | 114 void AddGLNativeLibrary(base::NativeLibrary library) { |
| 110 DCHECK(library); | 115 DCHECK(library); |
| 111 | 116 |
| 112 if (!g_libraries) { | 117 if (!g_libraries) { |
| 113 g_libraries = new LibraryArray; | 118 g_libraries = new LibraryArray; |
| 114 base::AtExitManager::RegisterCallback(CleanupNativeLibraries, NULL); | 119 base::AtExitManager::RegisterCallback(CleanupNativeLibraries, NULL); |
| 115 } | 120 } |
| 116 | 121 |
| 117 g_libraries->push_back(library); | 122 g_libraries->push_back(library); |
| 118 } | 123 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 137 if (g_get_proc_address) { | 142 if (g_get_proc_address) { |
| 138 void* proc = g_get_proc_address(name); | 143 void* proc = g_get_proc_address(name); |
| 139 if (proc) | 144 if (proc) |
| 140 return proc; | 145 return proc; |
| 141 } | 146 } |
| 142 | 147 |
| 143 return NULL; | 148 return NULL; |
| 144 } | 149 } |
| 145 | 150 |
| 146 } // namespace gfx | 151 } // namespace gfx |
| OLD | NEW |