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 #ifndef UI_GFX_GL_GL_IMPLEMENTATION_H_ | 5 #ifndef UI_GFX_GL_GL_IMPLEMENTATION_H_ |
6 #define UI_GFX_GL_GL_IMPLEMENTATION_H_ | 6 #define UI_GFX_GL_GL_IMPLEMENTATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
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/gfx/gl/gl_export.h" | 13 #include "ui/gfx/gl/gl_export.h" |
14 #include "ui/gfx/gl/gl_switches.h" | 14 #include "ui/gfx/gl/gl_switches.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 | 17 |
| 18 class GLContext; |
| 19 |
18 // The GL implementation currently in use. | 20 // The GL implementation currently in use. |
19 enum GLImplementation { | 21 enum GLImplementation { |
20 kGLImplementationNone, | 22 kGLImplementationNone, |
21 kGLImplementationDesktopGL, | 23 kGLImplementationDesktopGL, |
22 kGLImplementationOSMesaGL, | 24 kGLImplementationOSMesaGL, |
23 kGLImplementationEGLGLES2, | 25 kGLImplementationEGLGLES2, |
24 kGLImplementationMockGL | 26 kGLImplementationMockGL |
25 }; | 27 }; |
26 | 28 |
27 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
28 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); | 30 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); |
29 #else | 31 #else |
30 typedef void* (*GLGetProcAddressProc)(const char* name); | 32 typedef void* (*GLGetProcAddressProc)(const char* name); |
31 #endif | 33 #endif |
32 | 34 |
33 // Initialize a particular GL implementation. | 35 // Initialize a particular GL implementation. |
34 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); | 36 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); |
35 | 37 |
| 38 // Initialize extension function bindings for a GL implementation. |
| 39 GL_EXPORT bool InitializeGLExtensionBindings(GLImplementation implementation, |
| 40 GLContext* context); |
| 41 |
36 // Initialize Debug logging wrappers for GL bindings. | 42 // Initialize Debug logging wrappers for GL bindings. |
37 void InitializeDebugGLBindings(); | 43 void InitializeDebugGLBindings(); |
38 | 44 |
39 // Set the current GL implementation. | 45 // Set the current GL implementation. |
40 void SetGLImplementation(GLImplementation implementation); | 46 void SetGLImplementation(GLImplementation implementation); |
41 | 47 |
42 // Get the current GL implementation. | 48 // Get the current GL implementation. |
43 GL_EXPORT GLImplementation GetGLImplementation(); | 49 GL_EXPORT GLImplementation GetGLImplementation(); |
44 | 50 |
45 // Does the underlying GL support all features from Desktop GL 2.0 that were | 51 // Does the underlying GL support all features from Desktop GL 2.0 that were |
(...skipping 13 matching lines...) Expand all Loading... |
59 const GLImplementation* allowed_implementations_begin, | 65 const GLImplementation* allowed_implementations_begin, |
60 const GLImplementation* allowed_implementations_end, | 66 const GLImplementation* allowed_implementations_end, |
61 GLImplementation default_implementation); | 67 GLImplementation default_implementation); |
62 | 68 |
63 // Add a native library to those searched for GL entry points. | 69 // Add a native library to those searched for GL entry points. |
64 void AddGLNativeLibrary(base::NativeLibrary library); | 70 void AddGLNativeLibrary(base::NativeLibrary library); |
65 | 71 |
66 // Set an additional function that will be called to find GL entry points. | 72 // Set an additional function that will be called to find GL entry points. |
67 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); | 73 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); |
68 | 74 |
| 75 // 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 |
| 77 // GLGetProcAddressProc. |
| 78 void* GetGLCoreProcAddress(const char* name); |
| 79 |
69 // Find an entry point in the current GL implementation. | 80 // Find an entry point in the current GL implementation. |
70 void* GetGLProcAddress(const char* name); | 81 void* GetGLProcAddress(const char* name); |
71 | 82 |
72 } // namespace gfx | 83 } // namespace gfx |
73 | 84 |
74 #endif // UI_GFX_GL_GL_IMPLEMENTATION_H_ | 85 #endif // UI_GFX_GL_GL_IMPLEMENTATION_H_ |
OLD | NEW |