OLD | NEW |
(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" |
OLD | NEW |