Index: ui/gl/gl_gl_api_implementation.cc |
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc |
index 3ef10a54dc51cd73f82aa9c15d88535e3f1f98fa..9dbb29faac40b2a9d9507ed61c7ef00c610fdeb9 100644 |
--- a/ui/gl/gl_gl_api_implementation.cc |
+++ b/ui/gl/gl_gl_api_implementation.cc |
@@ -28,6 +28,8 @@ static RealGLApi* g_real_gl = NULL; |
static NoContextGLApi* g_no_context_gl = NULL; |
// A GL Api that calls TRACE and then calls another GL api. |
static TraceGLApi* g_trace_gl = NULL; |
+// The GL Api being used for stub contexts. If null, g_gl is used instead. |
+static GLApi* g_stub_gl = NULL; |
// GL version used when initializing dynamic bindings. |
static GLVersionInfo* g_version_info = NULL; |
@@ -380,10 +382,18 @@ void SetGLToRealGLApi() { |
SetGLApi(g_gl); |
} |
+void SetGLToStubGLApi() { |
+ SetGLApi(g_stub_gl ? g_stub_gl : g_gl); |
no sievers
2016/07/11 22:42:41
What uses GLContextStub in a way that this has to
piman
2016/07/11 23:57:27
The mock bindings use RealGLApi, but hooking GetPr
|
+} |
+ |
void SetGLApiToNoContext() { |
SetGLApi(g_no_context_gl); |
} |
+void SetStubGLApi(GLApi* api) { |
+ g_stub_gl = api; |
+} |
+ |
const GLVersionInfo* GetGLVersionInfo() { |
return g_version_info; |
} |
@@ -430,6 +440,7 @@ void ClearGLBindingsGL() { |
g_no_context_gl = NULL; |
} |
g_gl = NULL; |
+ g_stub_gl = NULL; |
g_driver_gl.ClearBindings(); |
if (g_current_gl_context_tls) { |
delete g_current_gl_context_tls; |