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

Unified Diff: ui/gl/gl_osmesa_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_osmesa_api_implementation.h ('k') | ui/gl/gl_stub_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_osmesa_api_implementation.cc
diff --git a/ui/gl/gl_osmesa_api_implementation.cc b/ui/gl/gl_osmesa_api_implementation.cc
index 2145711c3d879bdfcf989974c1200a89739ed30b..081fc3208b29c86b7723c4ab2a689489f8bf6e11 100644
--- a/ui/gl/gl_osmesa_api_implementation.cc
+++ b/ui/gl/gl_osmesa_api_implementation.cc
@@ -6,7 +6,8 @@
namespace gl {
-RealOSMESAApi* g_real_osmesa;
+RealOSMESAApi* g_real_osmesa = nullptr;
+DebugOSMESAApi* g_debug_osmesa = nullptr;
void InitializeStaticGLBindingsOSMESA() {
g_driver_osmesa.InitializeStaticBindings();
@@ -19,10 +20,17 @@ void InitializeStaticGLBindingsOSMESA() {
}
void InitializeDebugGLBindingsOSMESA() {
- g_driver_osmesa.InitializeDebugBindings();
+ if (!g_debug_osmesa) {
+ g_debug_osmesa = new DebugOSMESAApi(g_real_osmesa);
+ }
+ g_current_osmesa_context = g_debug_osmesa;
}
void ClearBindingsOSMESA() {
+ if (g_debug_osmesa) {
+ delete g_debug_osmesa;
+ g_debug_osmesa = NULL;
+ }
if (g_real_osmesa) {
delete g_real_osmesa;
g_real_osmesa = NULL;
@@ -58,6 +66,10 @@ void RealOSMESAApi::Initialize(DriverOSMESA* driver) {
InitializeBase(driver);
}
+DebugOSMESAApi::DebugOSMESAApi(OSMESAApi* osmesa_api)
+ : osmesa_api_(osmesa_api) {}
+DebugOSMESAApi::~DebugOSMESAApi() {}
+
TraceOSMESAApi::~TraceOSMESAApi() {
}
« no previous file with comments | « ui/gl/gl_osmesa_api_implementation.h ('k') | ui/gl/gl_stub_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698