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 #include "mojo/nacl/irt_mojo_nonsfi.h" | 5 #include "mojo/nacl/irt_mojo_nonsfi.h" |
6 | 6 |
7 #include "mojo/public/c/system/functions.h" | 7 #include "mojo/public/c/system/functions.h" |
8 #include "mojo/public/platform/nacl/mojo_irt.h" | 8 #include "mojo/public/platform/nacl/mojo_irt.h" |
9 #include "native_client/src/public/irt_core.h" | 9 #include "native_client/src/public/irt_core.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 MojoGetTimeTicksNow, | 32 MojoGetTimeTicksNow, |
33 MojoClose, | 33 MojoClose, |
34 MojoWait, | 34 MojoWait, |
35 MojoWaitMany, | 35 MojoWaitMany, |
36 MojoCreateMessagePipe, | 36 MojoCreateMessagePipe, |
37 MojoWriteMessage, | 37 MojoWriteMessage, |
38 MojoReadMessage, | 38 MojoReadMessage, |
39 _MojoGetInitialHandle, | 39 _MojoGetInitialHandle, |
40 }; | 40 }; |
41 | 41 |
| 42 const struct nacl_irt_mgl kIrtMGL = { |
| 43 MGLCreateContext, |
| 44 MGLDestroyContext, |
| 45 MGLMakeCurrent, |
| 46 MGLGetCurrentContext, |
| 47 MGLGetProcAddress, |
| 48 }; |
| 49 |
| 50 const struct nacl_irt_mgl_onscreen kIrtMGLOnScreen = { |
| 51 MGLResizeSurface, |
| 52 MGLSwapBuffers, |
| 53 }; |
| 54 |
42 const struct nacl_irt_interface kIrtInterfaces[] = { | 55 const struct nacl_irt_interface kIrtInterfaces[] = { |
43 {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}}; | 56 {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}, |
| 57 {NACL_IRT_MGL_v0_1, &kIrtMGL, sizeof(kIrtMGL), nullptr}, |
| 58 {NACL_IRT_MGL_ONSCREEN_v0_1, &kIrtMGLOnScreen, sizeof(kIrtMGLOnScreen), |
| 59 nullptr}, |
| 60 }; |
44 | 61 |
45 } // namespace | 62 } // namespace |
46 | 63 |
47 namespace nacl { | 64 namespace nacl { |
48 | 65 |
49 void MojoSetInitialHandle(MojoHandle handle) { | 66 void MojoSetInitialHandle(MojoHandle handle) { |
50 g_mojo_handle = handle; | 67 g_mojo_handle = handle; |
51 } | 68 } |
52 | 69 |
53 size_t MojoIrtNonsfiQuery(const char* interface_ident, | 70 size_t MojoIrtNonsfiQuery(const char* interface_ident, |
54 void* table, | 71 void* table, |
55 size_t tablesize) { | 72 size_t tablesize) { |
56 size_t result = nacl_irt_query_list(interface_ident, table, tablesize, | 73 size_t result = nacl_irt_query_list(interface_ident, table, tablesize, |
57 kIrtInterfaces, sizeof(kIrtInterfaces)); | 74 kIrtInterfaces, sizeof(kIrtInterfaces)); |
58 if (result != 0) | 75 if (result != 0) |
59 return result; | 76 return result; |
60 return nacl_irt_query_core(interface_ident, table, tablesize); | 77 return nacl_irt_query_core(interface_ident, table, tablesize); |
61 } | 78 } |
62 | 79 |
63 } // namespace nacl | 80 } // namespace nacl |
OLD | NEW |