Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: ui/gl/gl_implementation.h

Issue 98643013: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clarify code in generate_bindings.py according to feedback Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 35
36 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls); 36 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls);
37 37
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); 39 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name);
40 #else 40 #else
41 typedef void* (*GLGetProcAddressProc)(const char* name); 41 typedef void* (*GLGetProcAddressProc)(const char* name);
42 #endif 42 #endif
43 43
44 // Initialize a particular GL implementation. 44 // Initialize a particular GL implementation.
45 GL_EXPORT bool InitializeGLBindings(GLImplementation implementation); 45 GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation);
46 46
47 // Initialize extension function bindings for a GL implementation. 47 // Initialize function bindings that depend on the context for a GL
48 GL_EXPORT bool InitializeGLExtensionBindings(GLImplementation implementation, 48 // implementation.
49 GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation,
49 GLContext* context); 50 GLContext* context);
50 51
51 // Initialize Debug logging wrappers for GL bindings. 52 // Initialize Debug logging wrappers for GL bindings.
52 void InitializeDebugGLBindings(); 53 void InitializeDebugGLBindings();
53 54
54 // Initialize stub methods for drawing operations in the GL bindings. 55 // Initialize stub methods for drawing operations in the GL bindings.
55 void InitializeNullDrawGLBindings(); 56 void InitializeNullDrawGLBindings();
56 57
57 GL_EXPORT void ClearGLBindings(); 58 GL_EXPORT void ClearGLBindings();
58 59
(...skipping 15 matching lines...) Expand all
74 75
75 // Add a native library to those searched for GL entry points. 76 // Add a native library to those searched for GL entry points.
76 void AddGLNativeLibrary(base::NativeLibrary library); 77 void AddGLNativeLibrary(base::NativeLibrary library);
77 78
78 // Unloads all native libraries. 79 // Unloads all native libraries.
79 void UnloadGLNativeLibraries(); 80 void UnloadGLNativeLibraries();
80 81
81 // Set an additional function that will be called to find GL entry points. 82 // Set an additional function that will be called to find GL entry points.
82 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); 83 void SetGLGetProcAddressProc(GLGetProcAddressProc proc);
83 84
84 // Find a core (non-extension) entry point in the current GL implementation. On 85 // Find an entry point in the current GL implementation. Note that the function
85 // EGL based implementations core entry points will not be queried through 86 // may return a non-null pointer to something else than the GL function if an
86 // GLGetProcAddressProc. 87 // unsupported function is queried. Spec-compliant eglGetProcAddress and
87 void* GetGLCoreProcAddress(const char* name); 88 // glxGetProcAddress are allowed to return garbage for unsupported functions,
88 89 // and when querying functions from the EGL library supplied by Android, it may
89 // Find an entry point in the current GL implementation. 90 // return a function that prints a log message about the function being
91 // unsupported.
90 void* GetGLProcAddress(const char* name); 92 void* GetGLProcAddress(const char* name);
91 93
92 // Return information about the GL window system binding implementation (e.g., 94 // Return information about the GL window system binding implementation (e.g.,
93 // EGL, GLX, WGL). Returns true if the information was retrieved successfully. 95 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
94 GL_EXPORT bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info); 96 GL_EXPORT bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info);
95 97
96 } // namespace gfx 98 } // namespace gfx
97 99
98 #endif // UI_GL_GL_IMPLEMENTATION_H_ 100 #endif // UI_GL_GL_IMPLEMENTATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698