| 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 #ifndef UI_GL_GL_IMPLEMENTATION_H_ | 5 #ifndef UI_GL_GL_IMPLEMENTATION_H_ |
| 6 #define UI_GL_GL_IMPLEMENTATION_H_ | 6 #define UI_GL_GL_IMPLEMENTATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 struct GL_EXPORT GLWindowSystemBindingInfo { | 32 struct GL_EXPORT GLWindowSystemBindingInfo { |
| 33 GLWindowSystemBindingInfo(); | 33 GLWindowSystemBindingInfo(); |
| 34 std::string vendor; | 34 std::string vendor; |
| 35 std::string version; | 35 std::string version; |
| 36 std::string extensions; | 36 std::string extensions; |
| 37 bool direct_rendering; | 37 bool direct_rendering; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 void GL_EXPORT | 40 GL_EXPORT void GetAllowedGLImplementations( |
| 41 GetAllowedGLImplementations(std::vector<GLImplementation>* impls); | 41 std::vector<GLImplementation>* impls); |
| 42 | 42 |
| 43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 44 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); | 44 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); |
| 45 #else | 45 #else |
| 46 typedef void* (*GLGetProcAddressProc)(const char* name); | 46 typedef void* (*GLGetProcAddressProc)(const char* name); |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 // Initialize a particular GL implementation. | 49 // Initialize a particular GL implementation. |
| 50 GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation); | 50 GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation); |
| 51 | 51 |
| 52 // Initialize function bindings that depend on the context for a GL | 52 // Initialize function bindings that depend on the context for a GL |
| 53 // implementation. | 53 // implementation. |
| 54 GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation, | 54 GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation, |
| 55 GLContext* context); | 55 GLContext* context); |
| 56 | 56 |
| 57 // Initialize Debug logging wrappers for GL bindings. | 57 // Initialize Debug logging wrappers for GL bindings. |
| 58 void InitializeDebugGLBindings(); | 58 GL_EXPORT void InitializeDebugGLBindings(); |
| 59 | 59 |
| 60 // Initialize stub methods for drawing operations in the GL bindings. The | 60 // Initialize stub methods for drawing operations in the GL bindings. The |
| 61 // null draw bindings default to enabled, so that draw operations do nothing. | 61 // null draw bindings default to enabled, so that draw operations do nothing. |
| 62 void InitializeNullDrawGLBindings(); | 62 GL_EXPORT void InitializeNullDrawGLBindings(); |
| 63 | 63 |
| 64 // TODO(danakj): Remove this when all test suites are using null-draw. | 64 // TODO(danakj): Remove this when all test suites are using null-draw. |
| 65 GL_EXPORT bool HasInitializedNullDrawGLBindings(); | 65 GL_EXPORT bool HasInitializedNullDrawGLBindings(); |
| 66 | 66 |
| 67 // Filter a list of disabled_extensions from GL style space-separated | 67 // Filter a list of disabled_extensions from GL style space-separated |
| 68 // extension_list, returning a space separated list of filtered extensions, in | 68 // extension_list, returning a space separated list of filtered extensions, in |
| 69 // the same order as the input. | 69 // the same order as the input. |
| 70 GL_EXPORT std::string FilterGLExtensionList( | 70 GL_EXPORT std::string FilterGLExtensionList( |
| 71 const char* extension_list, | 71 const char* extension_list, |
| 72 const std::vector<std::string>& disabled_extensions); | 72 const std::vector<std::string>& disabled_extensions); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 88 GL_EXPORT void SetGLImplementation(GLImplementation implementation); | 88 GL_EXPORT void SetGLImplementation(GLImplementation implementation); |
| 89 | 89 |
| 90 // Get the current GL implementation. | 90 // Get the current GL implementation. |
| 91 GL_EXPORT GLImplementation GetGLImplementation(); | 91 GL_EXPORT GLImplementation GetGLImplementation(); |
| 92 | 92 |
| 93 // Does the underlying GL support all features from Desktop GL 2.0 that were | 93 // Does the underlying GL support all features from Desktop GL 2.0 that were |
| 94 // removed from the ES 2.0 spec without requiring specific extension strings. | 94 // removed from the ES 2.0 spec without requiring specific extension strings. |
| 95 GL_EXPORT bool HasDesktopGLFeatures(); | 95 GL_EXPORT bool HasDesktopGLFeatures(); |
| 96 | 96 |
| 97 // Get the GL implementation with a given name. | 97 // Get the GL implementation with a given name. |
| 98 GLImplementation GetNamedGLImplementation(const std::string& name); | 98 GL_EXPORT GLImplementation GetNamedGLImplementation(const std::string& name); |
| 99 | 99 |
| 100 // Get the name of a GL implementation. | 100 // Get the name of a GL implementation. |
| 101 const char* GetGLImplementationName(GLImplementation implementation); | 101 GL_EXPORT const char* GetGLImplementationName(GLImplementation implementation); |
| 102 | 102 |
| 103 // Add a native library to those searched for GL entry points. | 103 // Add a native library to those searched for GL entry points. |
| 104 void AddGLNativeLibrary(base::NativeLibrary library); | 104 void AddGLNativeLibrary(base::NativeLibrary library); |
| 105 | 105 |
| 106 // Unloads all native libraries. | 106 // Unloads all native libraries. |
| 107 void UnloadGLNativeLibraries(); | 107 void UnloadGLNativeLibraries(); |
| 108 | 108 |
| 109 // Set an additional function that will be called to find GL entry points. | 109 // Set an additional function that will be called to find GL entry points. |
| 110 // Exported so that tests may set the function used in the mock implementation. | 110 // Exported so that tests may set the function used in the mock implementation. |
| 111 GL_EXPORT void SetGLGetProcAddressProc(GLGetProcAddressProc proc); | 111 GL_EXPORT void SetGLGetProcAddressProc(GLGetProcAddressProc proc); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 137 GL_EXPORT bool WillUseGLGetStringForExtensions(); | 137 GL_EXPORT bool WillUseGLGetStringForExtensions(); |
| 138 | 138 |
| 139 // Helpers to load a library and log error on failure. | 139 // Helpers to load a library and log error on failure. |
| 140 base::NativeLibrary LoadLibraryAndPrintError( | 140 base::NativeLibrary LoadLibraryAndPrintError( |
| 141 const base::FilePath::CharType* filename); | 141 const base::FilePath::CharType* filename); |
| 142 base::NativeLibrary LoadLibraryAndPrintError(const base::FilePath& filename); | 142 base::NativeLibrary LoadLibraryAndPrintError(const base::FilePath& filename); |
| 143 | 143 |
| 144 } // namespace gl | 144 } // namespace gl |
| 145 | 145 |
| 146 #endif // UI_GL_GL_IMPLEMENTATION_H_ | 146 #endif // UI_GL_GL_IMPLEMENTATION_H_ |
| OLD | NEW |