| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const int32_t kNone = 0x3038; // EGL_NONE | 23 const int32_t kNone = 0x3038; // EGL_NONE |
| 24 | 24 |
| 25 base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky | 25 base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky |
| 26 g_gpu_interface; | 26 g_gpu_interface; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 extern "C" { | 30 extern "C" { |
| 31 |
| 31 MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle, | 32 MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle, |
| 32 const int32_t* attrib_list, | 33 const int32_t* attrib_list, |
| 33 MojoGLES2ContextLost lost_callback, | 34 MojoGLES2ContextLost lost_callback, |
| 34 void* closure) { | 35 void* closure) { |
| 35 mojo::MessagePipeHandle mph(handle); | 36 mojo::MessagePipeHandle mph(handle); |
| 36 mojo::ScopedMessagePipeHandle scoped_handle(mph); | 37 mojo::ScopedMessagePipeHandle scoped_handle(mph); |
| 37 std::vector<int32_t> attribs; | 38 std::vector<int32_t> attribs; |
| 38 if (attrib_list) { | 39 if (attrib_list) { |
| 39 for (int32_t const* p = attrib_list; *p != kNone;) { | 40 for (int32_t const* p = attrib_list; *p != kNone;) { |
| 40 attribs.push_back(*p++); | 41 attribs.push_back(*p++); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ | 80 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ |
| 80 ReturnType GL_APIENTRY gl##Function PARAMETERS { \ | 81 ReturnType GL_APIENTRY gl##Function PARAMETERS { \ |
| 81 DCHECK(g_gpu_interface.Get().Get()); \ | 82 DCHECK(g_gpu_interface.Get().Get()); \ |
| 82 return g_gpu_interface.Get().Get()->Function ARGUMENTS; \ | 83 return g_gpu_interface.Get().Get()->Function ARGUMENTS; \ |
| 83 } | 84 } |
| 84 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" | 85 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" |
| 85 #include "mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h" | 86 #include "mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h" |
| 86 #undef VISIT_GL_CALL | 87 #undef VISIT_GL_CALL |
| 87 | 88 |
| 88 } // extern "C" | 89 } // extern "C" |
| OLD | NEW |