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

Unified Diff: mojo/gles2/control_thunks_impl.cc

Issue 1354353002: Add GetProcAddress to OpenGL control interface (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Review feedback addressed Created 5 years, 3 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
Index: mojo/gles2/control_thunks_impl.cc
diff --git a/mojo/gles2/control_thunks_impl.cc b/mojo/gles2/control_thunks_impl.cc
index 81cad387fbf4f51cd64553fea3d6262de09e9de0..6a1d14dfb5bc3d0013ee2986a417972ecae25ac5 100644
--- a/mojo/gles2/control_thunks_impl.cc
+++ b/mojo/gles2/control_thunks_impl.cc
@@ -7,6 +7,15 @@
#include "mojo/gles2/gles2_context.h"
#include "mojo/public/cpp/system/message_pipe.h"
+extern "C" {
+
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
+ ReturnType MojoGLES2gl##Function PARAMETERS;
+#include "mojo/public/platform/native/gles2/call_visitor.h"
+#undef VISIT_GL_CALL
+
+}
+
namespace gles2 {
// static
@@ -52,6 +61,15 @@ void ControlThunksImpl::SwapBuffers() {
current_context_tls_.Get()->interface()->SwapBuffers();
}
+void* ControlThunksImpl::GetProcAddress(const char* name) {
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
+ if (!strcmp(name, "gl##Function")) \
+ return reinterpret_cast<void*>(MojoGLES2gl##Function);
+#include "mojo/public/platform/native/gles2/call_visitor.h"
+#undef VISIT_GL_CALL
+ return nullptr;
+}
+
void* ControlThunksImpl::GetGLES2Interface(MGLContext context) {
GLES2Context* client = reinterpret_cast<GLES2Context*>(context);
DCHECK(client);

Powered by Google App Engine
This is Rietveld 408576698