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.
5 #include "mojo/public/gles2/gles2.h"
7 #include "gpu/command_buffer/client/gles2_lib.h"
11 void MojoGLES2Initialize() {
15 void MojoGLES2Terminate() {
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
);
31 void MojoGLES2SwapBuffers() {
32 gles2::GetGLContext()->SwapBuffers();