OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_GFX_GL_GL_IMPLEMENTATION_H_ | |
6 #define UI_GFX_GL_GL_IMPLEMENTATION_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "base/native_library.h" | |
13 #include "build/build_config.h" | |
14 #include "ui/gfx/gl/gl_export.h" | |
15 #include "ui/gfx/gl/gl_switches.h" | |
16 | |
17 namespace gfx { | |
18 | |
19 class GLContext; | |
20 | |
21 // The GL implementation currently in use. | |
22 enum GLImplementation { | |
23 kGLImplementationNone, | |
24 kGLImplementationDesktopGL, | |
25 kGLImplementationOSMesaGL, | |
26 kGLImplementationAppleGL, | |
27 kGLImplementationEGLGLES2, | |
28 kGLImplementationMockGL | |
29 }; | |
30 | |
31 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls); | |
32 | |
33 #if defined(OS_WIN) | |
34 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); | |
35 #else | |
36 typedef void* (*GLGetProcAddressProc)(const char* name); | |
37 #endif | |
38 | |
39 // Initialize a particular GL implementation. | |
40 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); | |
41 | |
42 // Initialize extension function bindings for a GL implementation. | |
43 GL_EXPORT bool InitializeGLExtensionBindings(GLImplementation implementation, | |
44 GLContext* context); | |
45 | |
46 // Initialize Debug logging wrappers for GL bindings. | |
47 void InitializeDebugGLBindings(); | |
48 | |
49 void ClearGLBindings(); | |
50 | |
51 // Set the current GL implementation. | |
52 void SetGLImplementation(GLImplementation implementation); | |
53 | |
54 // Get the current GL implementation. | |
55 GL_EXPORT GLImplementation GetGLImplementation(); | |
56 | |
57 // Does the underlying GL support all features from Desktop GL 2.0 that were | |
58 // removed from the ES 2.0 spec without requiring specific extension strings. | |
59 GL_EXPORT bool HasDesktopGLFeatures(); | |
60 | |
61 // Get the GL implementation with a given name. | |
62 GLImplementation GetNamedGLImplementation(const std::string& name); | |
63 | |
64 // Get the name of a GL implementation. | |
65 const char* GetGLImplementationName(GLImplementation implementation); | |
66 | |
67 // Add a native library to those searched for GL entry points. | |
68 void AddGLNativeLibrary(base::NativeLibrary library); | |
69 | |
70 // Unloads all native libraries. | |
71 void UnloadGLNativeLibraries(); | |
72 | |
73 // Set an additional function that will be called to find GL entry points. | |
74 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); | |
75 | |
76 // Find a core (non-extension) entry point in the current GL implementation. On | |
77 // EGL based implementations core entry points will not be queried through | |
78 // GLGetProcAddressProc. | |
79 void* GetGLCoreProcAddress(const char* name); | |
80 | |
81 // Find an entry point in the current GL implementation. | |
82 void* GetGLProcAddress(const char* name); | |
83 | |
84 } // namespace gfx | |
85 | |
86 #endif // UI_GFX_GL_GL_IMPLEMENTATION_H_ | |
OLD | NEW |