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

Unified Diff: ui/gl/gl_wgl_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_wgl_api_implementation.h ('k') | ui/gl/gpu_timing_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_wgl_api_implementation.cc
diff --git a/ui/gl/gl_wgl_api_implementation.cc b/ui/gl/gl_wgl_api_implementation.cc
index c26312cdf9a09294663ca1f9100f751aa5152966..c6a500fc6d80b028839d19f22f59176170ca92ae 100644
--- a/ui/gl/gl_wgl_api_implementation.cc
+++ b/ui/gl/gl_wgl_api_implementation.cc
@@ -11,7 +11,8 @@
namespace gl {
-RealWGLApi* g_real_wgl;
+RealWGLApi* g_real_wgl = nullptr;
+DebugWGLApi* g_debug_wgl = nullptr;
void InitializeStaticGLBindingsWGL() {
g_driver_wgl.InitializeStaticBindings();
@@ -24,10 +25,17 @@ void InitializeStaticGLBindingsWGL() {
}
void InitializeDebugGLBindingsWGL() {
- g_driver_wgl.InitializeDebugBindings();
+ if (!g_debug_wgl) {
+ g_debug_wgl = new DebugWGLApi(g_real_wgl);
+ }
+ g_current_wgl_context = g_debug_wgl;
}
void ClearBindingsWGL() {
+ if (g_debug_wgl) {
+ delete g_debug_wgl;
+ g_debug_wgl = NULL;
+ }
if (g_real_wgl) {
delete g_real_wgl;
g_real_wgl = NULL;
@@ -111,6 +119,10 @@ const char* RealWGLApi::wglGetExtensionsStringEXTFn() {
return filtered_ext_exts_.c_str();
}
+DebugWGLApi::DebugWGLApi(WGLApi* wgl_api) : wgl_api_(wgl_api) {}
+
+DebugWGLApi::~DebugWGLApi() {}
+
TraceWGLApi::~TraceWGLApi() {
}
« no previous file with comments | « ui/gl/gl_wgl_api_implementation.h ('k') | ui/gl/gpu_timing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698