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 |
11 #include "base/native_library.h" | 11 #include "base/native_library.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "ui/gl/gl_export.h" | 13 #include "ui/gl/gl_export.h" |
14 #include "ui/gl/gl_switches.h" | 14 #include "ui/gl/gl_switches.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 | 17 |
18 class GLContext; | 18 class GLContext; |
19 | 19 |
20 // The GL implementation currently in use. | 20 // The GL implementation currently in use. |
21 enum GLImplementation { | 21 enum GLImplementation { |
22 kGLImplementationNone, | 22 kGLImplementationNone, |
23 kGLImplementationDesktopGL, | 23 kGLImplementationDesktopGL, |
24 kGLImplementationOSMesaGL, | 24 kGLImplementationOSMesaGL, |
25 kGLImplementationAppleGL, | 25 kGLImplementationAppleGL, |
26 kGLImplementationEGLGLES2, | 26 kGLImplementationEGLGLES2, |
27 kGLImplementationMockGL | 27 kGLImplementationMockGL |
28 }; | 28 }; |
29 | 29 |
| 30 struct GLWindowSystemBindingInfo { |
| 31 std::string vendor; |
| 32 std::string version; |
| 33 std::string extensions; |
| 34 }; |
| 35 |
30 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls); | 36 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls); |
31 | 37 |
32 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
33 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); | 39 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); |
34 #else | 40 #else |
35 typedef void* (*GLGetProcAddressProc)(const char* name); | 41 typedef void* (*GLGetProcAddressProc)(const char* name); |
36 #endif | 42 #endif |
37 | 43 |
38 // Initialize a particular GL implementation. | 44 // Initialize a particular GL implementation. |
39 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); | 45 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); | 79 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); |
74 | 80 |
75 // Find a core (non-extension) entry point in the current GL implementation. On | 81 // Find a core (non-extension) entry point in the current GL implementation. On |
76 // EGL based implementations core entry points will not be queried through | 82 // EGL based implementations core entry points will not be queried through |
77 // GLGetProcAddressProc. | 83 // GLGetProcAddressProc. |
78 void* GetGLCoreProcAddress(const char* name); | 84 void* GetGLCoreProcAddress(const char* name); |
79 | 85 |
80 // Find an entry point in the current GL implementation. | 86 // Find an entry point in the current GL implementation. |
81 void* GetGLProcAddress(const char* name); | 87 void* GetGLProcAddress(const char* name); |
82 | 88 |
| 89 // Return information about the GL window system binding implementation (e.g., |
| 90 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. |
| 91 GL_EXPORT bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info); |
| 92 |
83 } // namespace gfx | 93 } // namespace gfx |
84 | 94 |
85 #endif // UI_GL_GL_IMPLEMENTATION_H_ | 95 #endif // UI_GL_GL_IMPLEMENTATION_H_ |
OLD | NEW |