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

Unified Diff: mojo/public/platform/native/mgl_echo_thunks.h

Issue 1909133002: Add MGLEcho (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: git add Created 4 years, 8 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/platform/native/BUILD.gn ('k') | mojo/public/platform/native/mgl_echo_thunks.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/platform/native/mgl_echo_thunks.h
diff --git a/mojo/public/platform/native/mgl_echo_thunks.h b/mojo/public/platform/native/mgl_echo_thunks.h
new file mode 100644
index 0000000000000000000000000000000000000000..a2255d5320c92ae6ccbd5593089412f75c163553
--- /dev/null
+++ b/mojo/public/platform/native/mgl_echo_thunks.h
@@ -0,0 +1,47 @@
+// Copyright 2016 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.
+
+#ifndef MOJO_PUBLIC_PLATFORM_NATIVE_MGL_ECHO_THUNKS_H_
+#define MOJO_PUBLIC_PLATFORM_NATIVE_MGL_ECHO_THUNKS_H_
+
+#include <stddef.h>
+
+#include "mojo/public/c/gpu/MGL/mgl_echo.h"
+
+// Structure used to bind the MGL echo interface DSO to those of the embedder.
+//
+// This is the ABI between the embedder and the DSO. It can only have new
+// functions added to the end. No other changes are supported.
+#pragma pack(push, 8)
+struct MGLEchoThunks {
+ size_t size; // Should be set to sizeof(MGLEchoThunks).
+
+ void (*MGLEcho)(MGLEchoCallback callback, void* lost_callback_closure);
+};
+#pragma pack(pop)
+
+#ifdef __cplusplus
+// Intended to be called from the embedder. Returns an object initialized to
+// contain pointers to each of the embedder's MGLEchoThunks
+// functions.
+inline struct MGLEchoThunks MojoMakeMGLEchoThunks() {
+ struct MGLEchoThunks mgl_thunks = {
+ sizeof(struct MGLEchoThunks), MGLEcho,
+ };
+
+ return mgl_thunks;
+}
+#endif // __cplusplus
+
+// Use this type for the function found by dynamically discovering it in
+// a DSO linked with mojo_system. For example:
+// MojoSetMGLEchoThunksFn mojo_set_gles2_thunks_fn =
+// reinterpret_cast<MojoSetMGLEchoThunksFn>(
+// app_library.GetFunctionPointer("MojoSetMGLEchoThunks"));
+// The expected size of |mgl_thunks| is returned.
+// The contents of |mgl_thunks| are copied.
+typedef size_t (*MojoSetMGLEchoThunksFn)(
+ const struct MGLEchoThunks* mgl_echo_thunks);
+
+#endif // MOJO_PUBLIC_PLATFORM_NATIVE_MGL_ECHO_THUNKS_H_
« no previous file with comments | « mojo/public/platform/native/BUILD.gn ('k') | mojo/public/platform/native/mgl_echo_thunks.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698