| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/gles2/control_thunks_impl.h" | 5 #include "mojo/gles2/control_thunks_impl.h" |
| 6 | 6 |
| 7 #include "mojo/gles2/gles2_context.h" | 7 #include "mojo/gles2/gles2_context.h" |
| 8 #include "mojo/public/cpp/system/message_pipe.h" | 8 #include "mojo/public/cpp/system/message_pipe.h" |
| 9 | 9 |
| 10 extern "C" { | 10 extern "C" { |
| 11 | 11 |
| 12 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ | 12 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ |
| 13 ReturnType MojoGLES2gl##Function PARAMETERS; | 13 ReturnType MojoGLES2gl##Function PARAMETERS; |
| 14 #include "mojo/public/platform/native/gles2/call_visitor.h" | 14 #include "mojo/public/platform/native/gles2/call_visitor.h" |
| 15 #undef VISIT_GL_CALL | 15 #undef VISIT_GL_CALL |
| 16 | 16 |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace gles2 { | 19 namespace gles2 { |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 ControlThunksImpl* ControlThunksImpl::Get() { | 22 ControlThunksImpl* ControlThunksImpl::Get() { |
| 23 static base::LazyInstance<ControlThunksImpl>::Leaky thunks; | 23 static auto* thunks = new ControlThunksImpl; |
| 24 return thunks.Pointer(); | 24 return thunks; |
| 25 } | 25 } |
| 26 | 26 |
| 27 MGLContext ControlThunksImpl::CreateContext( | 27 MGLContext ControlThunksImpl::CreateContext( |
| 28 MGLOpenGLAPIVersion version, | 28 MGLOpenGLAPIVersion version, |
| 29 MojoHandle command_buffer_handle, | 29 MojoHandle command_buffer_handle, |
| 30 MGLContext share_group, | 30 MGLContext share_group, |
| 31 MGLContextLostCallback lost_callback, | 31 MGLContextLostCallback lost_callback, |
| 32 void* lost_callback_closure, | 32 void* lost_callback_closure, |
| 33 const struct MojoAsyncWaiter* async_waiter) { | 33 const struct MojoAsyncWaiter* async_waiter) { |
| 34 mojo::MessagePipeHandle mph(command_buffer_handle); | 34 mojo::MessagePipeHandle mph(command_buffer_handle); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return current_context_tls_.Get()->interface(); | 93 return current_context_tls_.Get()->interface(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 ControlThunksImpl::ControlThunksImpl() { | 96 ControlThunksImpl::ControlThunksImpl() { |
| 97 } | 97 } |
| 98 | 98 |
| 99 ControlThunksImpl::~ControlThunksImpl() { | 99 ControlThunksImpl::~ControlThunksImpl() { |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace gles2 | 102 } // namespace gles2 |
| OLD | NEW |