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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/gles2/README.md ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/gles2/gles2.h"
6
7 #include "gpu/command_buffer/client/gles2_lib.h"
8
9 extern "C" {
10
11 void MojoGLES2Initialize() {
12 gles2::Initialize();
13 }
14
15 void MojoGLES2Terminate() {
16 gles2::Terminate();
17 }
18
19 void MojoGLES2MakeCurrent(uint64_t encoded) {
20 // Ack, Hans! It's the giant hack.
21 // TODO(abarth): Replace this hack with something more disciplined. Most
22 // likley, we should receive a MojoHandle that we use to wire up the
23 // client side of an out-of-process command buffer. Given that we're
24 // still in-process, we just reinterpret_cast the value into a GL interface.
25 gpu::gles2::GLES2Interface* gl_interface =
26 reinterpret_cast<gpu::gles2::GLES2Interface*>(
27 static_cast<uintptr_t>(encoded));
28 gles2::SetGLContext(gl_interface);
29 }
30
31 void MojoGLES2SwapBuffers() {
32 gles2::GetGLContext()->SwapBuffers();
33 }
34
35 } // extern "C"
OLDNEW
« 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