| 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 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ | 5 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ |
| 6 #define MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ | 6 #define MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 MojoGLES2ContextLost lost_callback, | 24 MojoGLES2ContextLost lost_callback, |
| 25 void* closure, | 25 void* closure, |
| 26 const MojoAsyncWaiter* async_waiter); | 26 const MojoAsyncWaiter* async_waiter); |
| 27 void (*GLES2DestroyContext)(MojoGLES2Context context); | 27 void (*GLES2DestroyContext)(MojoGLES2Context context); |
| 28 void (*GLES2MakeCurrent)(MojoGLES2Context context); | 28 void (*GLES2MakeCurrent)(MojoGLES2Context context); |
| 29 void (*GLES2SwapBuffers)(); | 29 void (*GLES2SwapBuffers)(); |
| 30 | 30 |
| 31 // TODO(piman): We shouldn't have to leak this interface, especially in a | 31 // TODO(piman): We shouldn't have to leak this interface, especially in a |
| 32 // type-unsafe way. | 32 // type-unsafe way. |
| 33 void* (*GLES2GetGLES2Interface)(MojoGLES2Context context); | 33 void* (*GLES2GetGLES2Interface)(MojoGLES2Context context); |
| 34 | |
| 35 void (*GLES2SignalSyncPoint)(MojoGLES2Context context, | |
| 36 uint32_t sync_point, | |
| 37 MojoGLES2SignalSyncPointCallback callback, | |
| 38 void* closure); | |
| 39 }; | 34 }; |
| 40 #pragma pack(pop) | 35 #pragma pack(pop) |
| 41 | 36 |
| 42 // Intended to be called from the embedder. Returns an object initialized to | 37 // Intended to be called from the embedder. Returns an object initialized to |
| 43 // contain pointers to each of the embedder's MojoGLES2ControlThunks functions. | 38 // contain pointers to each of the embedder's MojoGLES2ControlThunks functions. |
| 44 inline MojoGLES2ControlThunks MojoMakeGLES2ControlThunks() { | 39 inline MojoGLES2ControlThunks MojoMakeGLES2ControlThunks() { |
| 45 MojoGLES2ControlThunks gles2_control_thunks = { | 40 MojoGLES2ControlThunks gles2_control_thunks = { |
| 46 sizeof(MojoGLES2ControlThunks), | 41 sizeof(MojoGLES2ControlThunks), |
| 47 MojoGLES2CreateContext, | 42 MojoGLES2CreateContext, |
| 48 MojoGLES2DestroyContext, | 43 MojoGLES2DestroyContext, |
| 49 MojoGLES2MakeCurrent, | 44 MojoGLES2MakeCurrent, |
| 50 MojoGLES2SwapBuffers, | 45 MojoGLES2SwapBuffers, |
| 51 MojoGLES2GetGLES2Interface, | 46 MojoGLES2GetGLES2Interface, |
| 52 MojoGLES2SignalSyncPoint, | |
| 53 }; | 47 }; |
| 54 | 48 |
| 55 return gles2_control_thunks; | 49 return gles2_control_thunks; |
| 56 } | 50 } |
| 57 | 51 |
| 58 // Use this type for the function found by dynamically discovering it in | 52 // Use this type for the function found by dynamically discovering it in |
| 59 // a DSO linked with mojo_system. For example: | 53 // a DSO linked with mojo_system. For example: |
| 60 // MojoSetGLES2ControlThunksFn mojo_set_gles2_control_thunks_fn = | 54 // MojoSetGLES2ControlThunksFn mojo_set_gles2_control_thunks_fn = |
| 61 // reinterpret_cast<MojoSetGLES2ControlThunksFn>( | 55 // reinterpret_cast<MojoSetGLES2ControlThunksFn>( |
| 62 // app_library.GetFunctionPointer("MojoSetGLES2ControlThunks")); | 56 // app_library.GetFunctionPointer("MojoSetGLES2ControlThunks")); |
| 63 // The expected size of |gles2_control_thunks| is returned. | 57 // The expected size of |gles2_control_thunks| is returned. |
| 64 // The contents of |gles2_control_thunks| are copied. | 58 // The contents of |gles2_control_thunks| are copied. |
| 65 typedef size_t (*MojoSetGLES2ControlThunksFn)( | 59 typedef size_t (*MojoSetGLES2ControlThunksFn)( |
| 66 const MojoGLES2ControlThunks* gles2_control_thunks); | 60 const MojoGLES2ControlThunks* gles2_control_thunks); |
| 67 | 61 |
| 68 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ | 62 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ |
| OLD | NEW |