| 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 <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/native_library.h" | 13 #include "base/native_library.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "ui/gl/gl_export.h" | 15 #include "ui/gl/gl_export.h" |
| 15 #include "ui/gl/gl_switches.h" | 16 #include "ui/gl/gl_switches.h" |
| 16 | 17 |
| 17 namespace gl { | 18 namespace gl { |
| 18 | 19 |
| 20 class GLApi; |
| 21 struct GLVersionInfo; |
| 22 |
| 19 // The GL implementation currently in use. | 23 // The GL implementation currently in use. |
| 20 enum GLImplementation { | 24 enum GLImplementation { |
| 21 kGLImplementationNone, | 25 kGLImplementationNone, |
| 22 kGLImplementationDesktopGL, | 26 kGLImplementationDesktopGL, |
| 23 kGLImplementationDesktopGLCoreProfile, | 27 kGLImplementationDesktopGLCoreProfile, |
| 24 kGLImplementationOSMesaGL, | 28 kGLImplementationOSMesaGL, |
| 25 kGLImplementationAppleGL, | 29 kGLImplementationAppleGL, |
| 26 kGLImplementationEGLGLES2, | 30 kGLImplementationEGLGLES2, |
| 27 kGLImplementationMockGL | 31 kGLImplementationMockGL, |
| 32 kGLImplementationStubGL, |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 struct GL_EXPORT GLWindowSystemBindingInfo { | 35 struct GL_EXPORT GLWindowSystemBindingInfo { |
| 31 GLWindowSystemBindingInfo(); | 36 GLWindowSystemBindingInfo(); |
| 32 std::string vendor; | 37 std::string vendor; |
| 33 std::string version; | 38 std::string version; |
| 34 std::string extensions; | 39 std::string extensions; |
| 35 bool direct_rendering; | 40 bool direct_rendering; |
| 36 }; | 41 }; |
| 37 | 42 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // unsupported. | 107 // unsupported. |
| 103 GL_EXPORT GLFunctionPointerType GetGLProcAddress(const char* name); | 108 GL_EXPORT GLFunctionPointerType GetGLProcAddress(const char* name); |
| 104 | 109 |
| 105 // Helper for fetching the OpenGL extensions from the current context. | 110 // Helper for fetching the OpenGL extensions from the current context. |
| 106 // This helper abstracts over differences between the desktop OpenGL | 111 // This helper abstracts over differences between the desktop OpenGL |
| 107 // core profile, and OpenGL ES and the compatibility profile. It's | 112 // core profile, and OpenGL ES and the compatibility profile. It's |
| 108 // intended for users of the bindings, not the implementation of the | 113 // intended for users of the bindings, not the implementation of the |
| 109 // bindings themselves. This is a relatively expensive call, so | 114 // bindings themselves. This is a relatively expensive call, so |
| 110 // callers should cache the result. | 115 // callers should cache the result. |
| 111 GL_EXPORT std::string GetGLExtensionsFromCurrentContext(); | 116 GL_EXPORT std::string GetGLExtensionsFromCurrentContext(); |
| 117 GL_EXPORT std::string GetGLExtensionsFromCurrentContext(GLApi* api); |
| 112 | 118 |
| 113 // Helper for the GL bindings implementation to understand whether | 119 // Helper for the GL bindings implementation to understand whether |
| 114 // glGetString(GL_EXTENSIONS) or glGetStringi(GL_EXTENSIONS, i) will | 120 // glGetString(GL_EXTENSIONS) or glGetStringi(GL_EXTENSIONS, i) will |
| 115 // be used in the function above. | 121 // be used in the function above. |
| 116 GL_EXPORT bool WillUseGLGetStringForExtensions(); | 122 GL_EXPORT bool WillUseGLGetStringForExtensions(); |
| 123 GL_EXPORT bool WillUseGLGetStringForExtensions(GLApi* api); |
| 124 |
| 125 GL_EXPORT std::unique_ptr<GLVersionInfo> GetVersionInfoFromContext(GLApi* api); |
| 117 | 126 |
| 118 // Helpers to load a library and log error on failure. | 127 // Helpers to load a library and log error on failure. |
| 119 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( | 128 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( |
| 120 const base::FilePath::CharType* filename); | 129 const base::FilePath::CharType* filename); |
| 121 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( | 130 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( |
| 122 const base::FilePath& filename); | 131 const base::FilePath& filename); |
| 123 | 132 |
| 124 } // namespace gl | 133 } // namespace gl |
| 125 | 134 |
| 126 #endif // UI_GL_GL_IMPLEMENTATION_H_ | 135 #endif // UI_GL_GL_IMPLEMENTATION_H_ |
| OLD | NEW |