| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 void UnloadGLNativeLibraries() { | 117 void UnloadGLNativeLibraries() { |
| 118 CleanupNativeLibraries(NULL); | 118 CleanupNativeLibraries(NULL); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void SetGLGetProcAddressProc(GLGetProcAddressProc proc) { | 121 void SetGLGetProcAddressProc(GLGetProcAddressProc proc) { |
| 122 DCHECK(proc); | 122 DCHECK(proc); |
| 123 g_get_proc_address = proc; | 123 g_get_proc_address = proc; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void* GetGLProcAddress(const char* name) { | 126 GLFunctionPointerType GetGLProcAddress(const char* name) { |
| 127 DCHECK(g_gl_implementation != kGLImplementationNone); | 127 DCHECK(g_gl_implementation != kGLImplementationNone); |
| 128 | 128 |
| 129 if (g_libraries) { | 129 if (g_libraries) { |
| 130 for (size_t i = 0; i < g_libraries->size(); ++i) { | 130 for (size_t i = 0; i < g_libraries->size(); ++i) { |
| 131 void* proc = base::GetFunctionPointerFromNativeLibrary((*g_libraries)[i], | 131 GLFunctionPointerType proc = reinterpret_cast<GLFunctionPointerType>( |
| 132 name); | 132 base::GetFunctionPointerFromNativeLibrary((*g_libraries)[i], name)); |
| 133 if (proc) | 133 if (proc) |
| 134 return proc; | 134 return proc; |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 if (g_get_proc_address) { | 137 if (g_get_proc_address) { |
| 138 void* proc = g_get_proc_address(name); | 138 GLFunctionPointerType proc = g_get_proc_address(name); |
| 139 if (proc) | 139 if (proc) |
| 140 return proc; | 140 return proc; |
| 141 } | 141 } |
| 142 | 142 |
| 143 return NULL; | 143 return NULL; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void InitializeNullDrawGLBindings() { | 146 void InitializeNullDrawGLBindings() { |
| 147 // This is platform independent, so it does not need to live in a platform | 147 // This is platform independent, so it does not need to live in a platform |
| 148 // specific implementation file. | 148 // specific implementation file. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); | 221 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); |
| 222 if (!library) { | 222 if (!library) { |
| 223 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " | 223 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " |
| 224 << error.ToString(); | 224 << error.ToString(); |
| 225 return NULL; | 225 return NULL; |
| 226 } | 226 } |
| 227 return library; | 227 return library; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace gl | 230 } // namespace gl |
| OLD | NEW |