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

Unified Diff: mojo/public/gles2/gles2_private.cc

Issue 425193002: Revert of mojo: Convert gles2 to the new thunking system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « mojo/public/gles2/gles2_private.h ('k') | mojo/public/platform/native/gles2_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/gles2/gles2_private.cc
diff --git a/mojo/public/gles2/gles2_private.cc b/mojo/public/gles2/gles2_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c82e9deede9fef3236acb3c0794b93673a063964
--- /dev/null
+++ b/mojo/public/gles2/gles2_private.cc
@@ -0,0 +1,80 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/gles2/gles2_private.h"
+
+#include <assert.h>
+#include <stddef.h>
+
+#include "mojo/public/c/gles2/gles2.h"
+#include "mojo/public/gles2/gles2_interface.h"
+
+static mojo::GLES2Support* g_gles2_support = NULL;
+static mojo::GLES2Interface* g_gles2_interface = NULL;
+
+extern "C" {
+
+void MojoGLES2Initialize(const MojoAsyncWaiter* async_waiter) {
+ assert(g_gles2_support);
+ return g_gles2_support->Initialize(async_waiter);
+}
+
+void MojoGLES2Terminate() {
+ assert(g_gles2_support);
+ return g_gles2_support->Terminate();
+}
+
+MojoGLES2Context MojoGLES2CreateContext(
+ MojoHandle handle,
+ MojoGLES2ContextLost lost_callback,
+ void* closure) {
+ return g_gles2_support->CreateContext(mojo::MessagePipeHandle(handle),
+ lost_callback,
+ closure);
+}
+
+void MojoGLES2DestroyContext(MojoGLES2Context context) {
+ return g_gles2_support->DestroyContext(context);
+}
+
+void MojoGLES2MakeCurrent(MojoGLES2Context context) {
+ assert(g_gles2_support);
+ g_gles2_support->MakeCurrent(context);
+ g_gles2_interface = g_gles2_support->GetGLES2InterfaceForCurrentContext();
+}
+
+void MojoGLES2SwapBuffers() {
+ assert(g_gles2_support);
+ return g_gles2_support->SwapBuffers();
+}
+
+void* MojoGLES2GetGLES2Interface(MojoGLES2Context context) {
+ assert(g_gles2_support);
+ return g_gles2_support->GetGLES2Interface(context);
+}
+
+void* MojoGLES2GetContextSupport(MojoGLES2Context context) {
+ assert(g_gles2_support);
+ return g_gles2_support->GetContextSupport(context);
+}
+
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
+ ReturnType gl##Function PARAMETERS { \
+ return g_gles2_interface->Function ARGUMENTS; \
+ }
+#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
+#undef VISIT_GL_CALL
+
+} // extern "C"
+
+namespace mojo {
+
+GLES2Support::~GLES2Support() {}
+
+void GLES2Support::Init(GLES2Support* gles2_support) {
+ assert(!g_gles2_support);
+ g_gles2_support = gles2_support;
+}
+
+} // namespace mojo
« no previous file with comments | « mojo/public/gles2/gles2_private.h ('k') | mojo/public/platform/native/gles2_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698