| 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 | 9 |
| 10 #include "mojo/public/c/gles2/gles2.h" | 10 #include "mojo/public/c/gles2/gles2.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // 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 |
| 53 // a DSO linked with mojo_system. For example: | 53 // a DSO linked with mojo_system. For example: |
| 54 // MojoSetGLES2ControlThunksFn mojo_set_gles2_control_thunks_fn = | 54 // MojoSetGLES2ControlThunksFn mojo_set_gles2_control_thunks_fn = |
| 55 // reinterpret_cast<MojoSetGLES2ControlThunksFn>( | 55 // reinterpret_cast<MojoSetGLES2ControlThunksFn>( |
| 56 // app_library.GetFunctionPointer("MojoSetGLES2ControlThunks")); | 56 // app_library.GetFunctionPointer("MojoSetGLES2ControlThunks")); |
| 57 // The expected size of |gles2_control_thunks| is returned. | 57 // The expected size of |gles2_control_thunks| is returned. |
| 58 // The contents of |gles2_control_thunks| are copied. | 58 // The contents of |gles2_control_thunks| are copied. |
| 59 typedef size_t (*MojoSetGLES2ControlThunksFn)( | 59 typedef size_t (*MojoSetGLES2ControlThunksFn)( |
| 60 const MojoGLES2ControlThunks* gles2_control_thunks); | 60 const MojoGLES2ControlThunks* gles2_control_thunks); |
| 61 | 61 |
| 62 // ----------------------------------------------------------------------------- | |
| 63 | |
| 64 // Like MojoGLES2ControlThunks, but specifies the frozen GLES2 API. Separated | |
| 65 // out as MojoGLES2ControlThunks may be modified and added to, but this | |
| 66 // interface is frozen. | |
| 67 #pragma pack(push, 8) | |
| 68 struct MojoGLES2ImplThunks { | |
| 69 size_t size; // Should be set to sizeof(MojoGLES2ImplThunks). | |
| 70 | |
| 71 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ | |
| 72 ReturnType (*Function) PARAMETERS; | |
| 73 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" | |
| 74 #undef VISIT_GL_CALL | |
| 75 }; | |
| 76 #pragma pack(pop) | |
| 77 | |
| 78 // Intended to be called from the embedder to get the embedder's implementation | |
| 79 // of GLES2. | |
| 80 inline MojoGLES2ImplThunks MojoMakeGLES2ImplThunks() { | |
| 81 MojoGLES2ImplThunks gles2_impl_thunks = { | |
| 82 sizeof(MojoGLES2ImplThunks), | |
| 83 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ | |
| 84 gl##Function, | |
| 85 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" | |
| 86 #undef VISIT_GL_CALL | |
| 87 }; | |
| 88 | |
| 89 return gles2_impl_thunks; | |
| 90 } | |
| 91 | |
| 92 // Use this type for the function found by dynamically discovering it in | |
| 93 // a DSO linked with mojo_system. For example: | |
| 94 // MojoSetGLES2ImplThunksFn mojo_set_gles2_impl_thunks_fn = | |
| 95 // reinterpret_cast<MojoSetGLES2ImplThunksFn>( | |
| 96 // app_library.GetFunctionPointer("MojoSetGLES2ImplThunks")); | |
| 97 // The expected size of |gles2_impl_thunks| is returned. | |
| 98 // The contents of |gles2_impl_thunks| are copied. | |
| 99 typedef size_t (*MojoSetGLES2ImplThunksFn)( | |
| 100 const MojoGLES2ImplThunks* gles2_impl_thunks); | |
| 101 | |
| 102 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ | 62 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_THUNKS_H_ |
| OLD | NEW |