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

Unified Diff: ui/gl/gl_glx_api_implementation.cc

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_glx_api_implementation.h ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_glx_api_implementation.cc
diff --git a/ui/gl/gl_glx_api_implementation.cc b/ui/gl/gl_glx_api_implementation.cc
index 01734bb70875174263e00950f2808a6aeea93161..413a385f2e63a2448db57faddc45b8cf8bb1239d 100644
--- a/ui/gl/gl_glx_api_implementation.cc
+++ b/ui/gl/gl_glx_api_implementation.cc
@@ -12,6 +12,7 @@
namespace gl {
RealGLXApi* g_real_glx;
+DebugGLXApi* g_debug_glx;
void InitializeStaticGLBindingsGLX() {
g_driver_glx.InitializeStaticBindings();
@@ -24,10 +25,17 @@ void InitializeStaticGLBindingsGLX() {
}
void InitializeDebugGLBindingsGLX() {
- g_driver_glx.InitializeDebugBindings();
+ if (!g_debug_glx) {
+ g_debug_glx = new DebugGLXApi(g_real_glx);
+ }
+ g_current_glx_context = g_debug_glx;
}
void ClearBindingsGLX() {
+ if (g_debug_glx) {
+ delete g_debug_glx;
+ g_debug_glx = NULL;
+ }
if (g_real_glx) {
delete g_real_glx;
g_real_glx = NULL;
@@ -96,6 +104,9 @@ const char* RealGLXApi::glXQueryExtensionsStringFn(Display* dpy,
return filtered_exts_.c_str();
}
+DebugGLXApi::DebugGLXApi(GLXApi* glx_api) : glx_api_(glx_api) {}
+DebugGLXApi::~DebugGLXApi() {}
+
TraceGLXApi::~TraceGLXApi() {
}
« no previous file with comments | « ui/gl/gl_glx_api_implementation.h ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698