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

Unified Diff: ui/gl/gl_bindings.h

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_api_unittest.cc ('k') | ui/gl/gl_bindings_autogen_egl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_bindings.h
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h
index 322b2c2b7524d2eccaf92f6b3b298588e13eee6c..3ea6199b175255a3abb5b2d54a5ebe45a77c5e42 100644
--- a/ui/gl/gl_bindings.h
+++ b/ui/gl/gl_bindings.h
@@ -397,34 +397,30 @@ typedef uint64_t EGLuint64CHROMIUM;
namespace gl {
+struct GLVersionInfo;
+
struct GL_EXPORT DriverGL {
void InitializeStaticBindings();
- void InitializeCustomDynamicBindings(GLContext* context);
- void InitializeDebugBindings();
- void InitializeNullDrawBindings();
- // TODO(danakj): Remove this when all test suites are using null-draw.
- bool HasInitializedNullDrawBindings();
- bool SetNullDrawBindingsEnabled(bool enabled);
+ void InitializeDynamicBindings(const GLVersionInfo* ver,
+ const std::string& context_extensions);
void ClearBindings();
ProcsGL fn;
- ProcsGL orig_fn;
- ProcsGL debug_fn;
ExtensionsGL ext;
- bool null_draw_bindings_enabled;
+};
- private:
- void InitializeDynamicBindings(GLContext* context);
+struct GL_EXPORT CurrentGL {
+ GLApi* Api = nullptr;
+ DriverGL* Driver = nullptr;
+ const GLVersionInfo* Version = nullptr;
};
struct GL_EXPORT DriverOSMESA {
void InitializeStaticBindings();
void InitializeExtensionBindings();
- void InitializeDebugBindings();
void ClearBindings();
ProcsOSMESA fn;
- ProcsOSMESA debug_fn;
ExtensionsOSMESA ext;
private:
@@ -435,11 +431,9 @@ struct GL_EXPORT DriverOSMESA {
struct GL_EXPORT DriverWGL {
void InitializeStaticBindings();
void InitializeExtensionBindings();
- void InitializeDebugBindings();
void ClearBindings();
ProcsWGL fn;
- ProcsWGL debug_fn;
ExtensionsWGL ext;
private:
@@ -452,11 +446,9 @@ struct GL_EXPORT DriverEGL {
void InitializeStaticBindings();
void InitializeClientExtensionBindings();
void InitializeExtensionBindings();
- void InitializeDebugBindings();
void ClearBindings();
ProcsEGL fn;
- ProcsEGL debug_fn;
ExtensionsEGL ext;
static std::string GetPlatformExtensions();
@@ -468,11 +460,9 @@ struct GL_EXPORT DriverEGL {
struct GL_EXPORT DriverGLX {
void InitializeStaticBindings();
void InitializeExtensionBindings();
- void InitializeDebugBindings();
void ClearBindings();
ProcsGLX fn;
- ProcsGLX debug_fn;
ExtensionsGLX ext;
private:
@@ -481,11 +471,12 @@ struct GL_EXPORT DriverGLX {
#endif
// This #define is here to support autogenerated code.
-#define g_current_gl_context g_current_gl_context_tls->Get()
-GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls;
+#define g_current_gl_context g_current_gl_context_tls->Get()->Api
+#define g_current_gl_driver g_current_gl_context_tls->Get()->Driver
+#define g_current_gl_version g_current_gl_context_tls->Get()->Version
+GL_EXPORT extern base::ThreadLocalPointer<CurrentGL>* g_current_gl_context_tls;
GL_EXPORT extern OSMESAApi* g_current_osmesa_context;
-GL_EXPORT extern DriverGL g_driver_gl;
GL_EXPORT extern DriverOSMESA g_driver_osmesa;
#if defined(USE_EGL)
« no previous file with comments | « ui/gl/gl_api_unittest.cc ('k') | ui/gl/gl_bindings_autogen_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698