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

Unified Diff: mojo/public/platform/native/mgl_onscreen_thunks.c

Issue 1288583002: Add MGL entry points and port spinning_cube to use them (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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/mgl_onscreen_thunks.h ('k') | mojo/public/platform/native/mgl_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/platform/native/mgl_onscreen_thunks.c
diff --git a/mojo/public/platform/native/mgl_onscreen_thunks.c b/mojo/public/platform/native/mgl_onscreen_thunks.c
new file mode 100644
index 0000000000000000000000000000000000000000..c41b583b6358c5b22f3423ac67ff9dbbcab6bf86
--- /dev/null
+++ b/mojo/public/platform/native/mgl_onscreen_thunks.c
@@ -0,0 +1,28 @@
+// Copyright 2015 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/platform/native/mgl_onscreen_thunks.h"
+
+#include <assert.h>
+
+#include "mojo/public/platform/native/thunk_export.h"
+
+static struct MGLOnscreenThunks g_onscreen_thunks = {0};
+
+void MGLResizeSurface(uint32_t width, uint32_t height) {
+ assert(g_onscreen_thunks.MGLResizeSurface);
+ g_onscreen_thunks.MGLResizeSurface(width, height);
+}
+
+void MGLSwapBuffers(void) {
+ assert(g_onscreen_thunks.MGLSwapBuffers);
+ g_onscreen_thunks.MGLSwapBuffers();
+}
+
+THUNK_EXPORT size_t MojoSetMGLOnscreenThunks(
+ const struct MGLOnscreenThunks* mgl_onscreen_thunks) {
+ if (mgl_onscreen_thunks->size >= sizeof(g_onscreen_thunks))
+ g_onscreen_thunks = *mgl_onscreen_thunks;
+ return sizeof(g_onscreen_thunks);
+}
« no previous file with comments | « mojo/public/platform/native/mgl_onscreen_thunks.h ('k') | mojo/public/platform/native/mgl_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698