| Index: mojo/gles2/adaptor.cc
|
| diff --git a/mojo/gles2/adaptor.cc b/mojo/gles2/adaptor.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e274d27bc324a0762757baa6fd0016c8accc24d0
|
| --- /dev/null
|
| +++ b/mojo/gles2/adaptor.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/adaptor.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"
|
|
|