Chromium Code Reviews| 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 // WARNING this file was generated by generate_nacl_bindings.py | 5 // WARNING this file was generated by generate_nacl_bindings.py |
|
Mark Seaborn
2015/10/20 17:24:29
Same with this file -- it's also generated. Let's
Petr Hosek
2015/10/20 21:38:31
Done.
| |
| 6 // Do not edit by hand. | 6 // Do not edit by hand. |
| 7 | 7 |
| 8 #ifndef MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ | 8 #ifndef MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ |
| 9 #define MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ | 9 #define MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ |
| 10 | 10 |
| 11 #include "mojo/public/c/gpu/MGL/mgl.h" | |
| 12 #include "mojo/public/c/gpu/MGL/mgl_onscreen.h" | |
| 13 #include "mojo/public/c/gpu/MGL/mgl_signal_sync_point.h" | |
| 11 #include "mojo/public/c/system/buffer.h" | 14 #include "mojo/public/c/system/buffer.h" |
| 12 #include "mojo/public/c/system/data_pipe.h" | 15 #include "mojo/public/c/system/data_pipe.h" |
| 13 #include "mojo/public/c/system/message_pipe.h" | 16 #include "mojo/public/c/system/message_pipe.h" |
| 14 #include "mojo/public/c/system/types.h" | 17 #include "mojo/public/c/system/types.h" |
| 15 | 18 |
| 16 #define NACL_IRT_MOJO_v0_1 "nacl-irt-mojo-0.1" | 19 #define NACL_IRT_MOJO_v0_1 "nacl-irt-mojo-0.1" |
| 17 | 20 |
| 18 struct nacl_irt_mojo { | 21 struct nacl_irt_mojo { |
| 19 MojoResult (*MojoCreateSharedBuffer)( | 22 MojoResult (*MojoCreateSharedBuffer)( |
| 20 const struct MojoCreateSharedBufferOptions* options, | 23 const struct MojoCreateSharedBufferOptions* options, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 MojoWriteMessageFlags flags); | 81 MojoWriteMessageFlags flags); |
| 79 MojoResult (*MojoReadMessage)(MojoHandle message_pipe_handle, | 82 MojoResult (*MojoReadMessage)(MojoHandle message_pipe_handle, |
| 80 void* bytes, | 83 void* bytes, |
| 81 uint32_t* num_bytes, | 84 uint32_t* num_bytes, |
| 82 MojoHandle* handles, | 85 MojoHandle* handles, |
| 83 uint32_t* num_handles, | 86 uint32_t* num_handles, |
| 84 MojoReadMessageFlags flags); | 87 MojoReadMessageFlags flags); |
| 85 MojoResult (*_MojoGetInitialHandle)(MojoHandle* handle); | 88 MojoResult (*_MojoGetInitialHandle)(MojoHandle* handle); |
| 86 }; | 89 }; |
| 87 | 90 |
| 91 #define NACL_IRT_MGL_v0_1 "nacl-irt-mgl-0.1" | |
| 92 | |
| 93 struct nacl_irt_mgl { | |
| 94 // Creates a context at the given API version or returns MGL_NO_CONTEXT. | |
| 95 // |command_buffer_handle| must be a command buffer message pipe handle from | |
| 96 // the Gpu service or another source. The callee takes ownership of this | |
| 97 // handle. | |
| 98 // |share_group| specifies the share group to create this context in. If this | |
| 99 // is MGL_NO_CONTEXT a new share group will be created for this context. | |
| 100 // |lost_callback|, if not null, will be invoked when the context is lost. | |
| 101 // |async_waiter| must be a pointer to a MojoAsyncWaiter implementation that | |
| 102 // is usable from any thread the returned MGLContext will be used from for as | |
| 103 // long as the context exists. | |
| 104 MGLContext (*MGLCreateContext)(MGLOpenGLAPIVersion version, | |
| 105 MojoHandle command_buffer_handle, | |
| 106 MGLContext share_group, | |
| 107 MGLContextLostCallback lost_callback, | |
| 108 void* lost_callback_closure, | |
| 109 const struct MojoAsyncWaiter* async_waiter); | |
| 110 | |
| 111 // Destroys the |context|. | |
| 112 void (*MGLDestroyContext)(MGLContext context); | |
| 113 | |
| 114 // Makes |context| the current MGLContext for the calling thread. Calling with | |
| 115 // MGL_NO_CONTEXT clears the current context. | |
| 116 void (*MGLMakeCurrent)(MGLContext context); | |
| 117 | |
| 118 // Returns the currently bound context for the calling thread or | |
| 119 // MGL_NO_CONTEXT if there is none. | |
| 120 MGLContext (*MGLGetCurrentContext)(void); | |
| 121 | |
| 122 // Returns GL function usable in any context that advertise the corresponding | |
|
Mark Seaborn
2015/10/20 01:24:32
"advertises"
| |
| 123 // extension in their GL_EXTENSIONS string, or null for functions that the | |
| 124 // implementation does not support. The implementation only advertises GL | |
| 125 // functions. | |
| 126 // |name| is the name of the GL function. | |
| 127 MGLMustCastToProperFunctionPointerType (*MGLGetProcAddress)(const char* name); | |
| 128 }; | |
| 129 | |
| 130 #define NACL_IRT_MGL_ONSCREEN_v0_1 "nacl-irt-mgl-onscreen-0.1" | |
| 131 | |
| 132 struct nacl_irt_mgl_onscreen { | |
| 133 // Resizes the default framebuffer for the currently bound onscreen | |
|
Mark Seaborn
2015/10/20 01:24:32
Aside: For the record, having a "currently bound"
| |
| 134 // MGLContext. | |
| 135 void (*MGLResizeSurface)(uint32_t width, uint32_t height); | |
| 136 | |
| 137 // Presents the default framebuffer for the currently bound onscreen | |
| 138 // MGLContext to the windowing system or display. | |
| 139 void (*MGLSwapBuffers)(void); | |
| 140 }; | |
| 141 | |
| 142 #define NACL_IRT_MGL_SIGNAL_SYNC_POINT_v0_1 "nacl-irt-mgl-signal-sync-point-0.1" | |
| 143 | |
| 144 struct nacl_irt_mgl_signal_sync_point { | |
| 145 // MGLSignalSyncPoint signals the given sync point in the current context and | |
| 146 // invokes |callback| when the service side acknowleges that the sync point | |
|
Mark Seaborn
2015/10/20 01:24:32
"acknowledges"
| |
| 147 // has been passed. | |
| 148 void (*MGLSignalSyncPoint)(uint32_t sync_point, | |
| 149 MGLSignalSyncPointCallback callback, | |
| 150 void* closure); | |
| 151 }; | |
| 152 | |
| 88 #ifdef __cplusplus | 153 #ifdef __cplusplus |
| 89 extern "C" { | 154 extern "C" { |
| 90 #endif | 155 #endif |
| 91 | 156 |
| 92 size_t mojo_irt_query(const char* interface_ident, | 157 size_t mojo_irt_query(const char* interface_ident, |
| 93 void* table, | 158 void* table, |
| 94 size_t tablesize); | 159 size_t tablesize); |
| 95 | 160 |
| 96 #ifdef __cplusplus | 161 #ifdef __cplusplus |
| 97 } | 162 } |
| 98 #endif | 163 #endif |
| 99 | 164 |
| 100 #endif // MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ | 165 #endif // MOJO_PUBLIC_PLATFORM_NACL_MOJO_IRT_H_ |
| OLD | NEW |