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/nonsfi/irt_mojo_nonsfi.h" | 5 #include "mojo/nacl/nonsfi/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 |
| 55 const struct nacl_irt_mgl_signal_sync_point kIrtMGLSignalSyncPoint = { |
| 56 MGLSignalSyncPoint, |
| 57 }; |
| 58 |
42 const struct nacl_irt_interface kIrtInterfaces[] = { | 59 const struct nacl_irt_interface kIrtInterfaces[] = { |
43 {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}}; | 60 {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}, |
| 61 {NACL_IRT_MGL_v0_1, &kIrtMGL, sizeof(kIrtMGL), nullptr}, |
| 62 {NACL_IRT_MGL_ONSCREEN_v0_1, &kIrtMGLOnScreen, sizeof(kIrtMGLOnScreen), |
| 63 nullptr}, |
| 64 {NACL_IRT_MGL_SIGNAL_SYNC_POINT_v0_1, &kIrtMGLSignalSyncPoint, |
| 65 sizeof(kIrtMGLSignalSyncPoint), nullptr}, |
| 66 }; |
44 | 67 |
45 } // namespace | 68 } // namespace |
46 | 69 |
47 namespace nacl { | 70 namespace nacl { |
48 | 71 |
49 void MojoSetInitialHandle(MojoHandle handle) { | 72 void MojoSetInitialHandle(MojoHandle handle) { |
50 g_mojo_handle = handle; | 73 g_mojo_handle = handle; |
51 } | 74 } |
52 | 75 |
53 size_t MojoIrtNonsfiQuery(const char* interface_ident, | 76 size_t MojoIrtNonsfiQuery(const char* interface_ident, |
54 void* table, | 77 void* table, |
55 size_t tablesize) { | 78 size_t tablesize) { |
56 size_t result = nacl_irt_query_list(interface_ident, table, tablesize, | 79 size_t result = nacl_irt_query_list(interface_ident, table, tablesize, |
57 kIrtInterfaces, sizeof(kIrtInterfaces)); | 80 kIrtInterfaces, sizeof(kIrtInterfaces)); |
58 if (result != 0) | 81 if (result != 0) |
59 return result; | 82 return result; |
60 return nacl_irt_query_core(interface_ident, table, tablesize); | 83 return nacl_irt_query_core(interface_ident, table, tablesize); |
61 } | 84 } |
62 | 85 |
63 } // namespace nacl | 86 } // namespace nacl |
OLD | NEW |