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

Unified Diff: mojo/gles2/gles2.cc

Issue 101413002: [Mojo] Remove dependency between mojo/public and gpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/gles2/README.md ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/gles2.cc
diff --git a/mojo/gles2/gles2.cc b/mojo/gles2/gles2.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c90a3318f25c7fd556a83b8660aec304a9fcde4f
--- /dev/null
+++ b/mojo/gles2/gles2.cc
@@ -0,0 +1,35 @@
+// Copyright 2013 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.h"
+
+#include "gpu/command_buffer/client/gles2_lib.h"
+
+extern "C" {
+
+void MojoGLES2Initialize() {
+ gles2::Initialize();
+}
+
+void MojoGLES2Terminate() {
+ gles2::Terminate();
+}
+
+void MojoGLES2MakeCurrent(uint64_t encoded) {
+ // Ack, Hans! It's the giant hack.
+ // TODO(abarth): Replace this hack with something more disciplined. Most
+ // likley, we should receive a MojoHandle that we use to wire up the
+ // client side of an out-of-process command buffer. Given that we're
+ // still in-process, we just reinterpret_cast the value into a GL interface.
+ gpu::gles2::GLES2Interface* gl_interface =
+ reinterpret_cast<gpu::gles2::GLES2Interface*>(
+ static_cast<uintptr_t>(encoded));
+ gles2::SetGLContext(gl_interface);
+}
+
+void MojoGLES2SwapBuffers() {
+ gles2::GetGLContext()->SwapBuffers();
+}
+
+} // extern "C"
« no previous file with comments | « mojo/gles2/README.md ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698