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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2136223002: Introduce GLStubApi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_gl_api_implementation.h ('k') | ui/gl/gl_mock_autogen_gl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ui/gl/gl_gl_api_implementation.h ('k') | ui/gl/gl_mock_autogen_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698