| 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 "mojo/public/platform/native/gles2_thunks.h" | 5 #include "mojo/public/platform/native/gles2_thunks.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "mojo/public/platform/native/thunk_export.h" | 11 #include "mojo/public/platform/native/thunk_export.h" |
| 12 | 12 |
| 13 extern "C" { | 13 extern "C" { |
| 14 | 14 |
| 15 static MojoGLES2ControlThunks g_control_thunks = {0}; | 15 static MojoGLES2ControlThunks g_control_thunks = {0}; |
| 16 | 16 |
| 17 MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle, | 17 MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle, |
| 18 const int32_t* attrib_list, | 18 const int32_t* attrib_list, |
| 19 MojoGLES2ContextLost lost_callback, | 19 MojoGLES2ContextLost lost_callback, |
| 20 void* closure, | 20 void* closure) { |
| 21 const MojoAsyncWaiter* async_waiter) { | |
| 22 assert(g_control_thunks.GLES2CreateContext); | 21 assert(g_control_thunks.GLES2CreateContext); |
| 23 return g_control_thunks.GLES2CreateContext( | 22 return g_control_thunks.GLES2CreateContext(handle, attrib_list, lost_callback, |
| 24 handle, attrib_list, lost_callback, closure, async_waiter); | 23 closure); |
| 25 } | 24 } |
| 26 | 25 |
| 27 void MojoGLES2DestroyContext(MojoGLES2Context context) { | 26 void MojoGLES2DestroyContext(MojoGLES2Context context) { |
| 28 assert(g_control_thunks.GLES2DestroyContext); | 27 assert(g_control_thunks.GLES2DestroyContext); |
| 29 g_control_thunks.GLES2DestroyContext(context); | 28 g_control_thunks.GLES2DestroyContext(context); |
| 30 } | 29 } |
| 31 | 30 |
| 32 void MojoGLES2MakeCurrent(MojoGLES2Context context) { | 31 void MojoGLES2MakeCurrent(MojoGLES2Context context) { |
| 33 assert(g_control_thunks.GLES2MakeCurrent); | 32 assert(g_control_thunks.GLES2MakeCurrent); |
| 34 g_control_thunks.GLES2MakeCurrent(context); | 33 g_control_thunks.GLES2MakeCurrent(context); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 } | 44 } |
| 46 | 45 |
| 47 extern "C" THUNK_EXPORT size_t MojoSetGLES2ControlThunks( | 46 extern "C" THUNK_EXPORT size_t MojoSetGLES2ControlThunks( |
| 48 const MojoGLES2ControlThunks* gles2_control_thunks) { | 47 const MojoGLES2ControlThunks* gles2_control_thunks) { |
| 49 if (gles2_control_thunks->size >= sizeof(g_control_thunks)) | 48 if (gles2_control_thunks->size >= sizeof(g_control_thunks)) |
| 50 g_control_thunks = *gles2_control_thunks; | 49 g_control_thunks = *gles2_control_thunks; |
| 51 return sizeof(g_control_thunks); | 50 return sizeof(g_control_thunks); |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // extern "C" | 53 } // extern "C" |
| OLD | NEW |