OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # This file declares the RPC methods used to implement the Pepper 3D drawing |
| 6 # API. |
| 7 # TODO(neb): Figure what the threading model really is. Keep the following |
| 8 # comment here until then, although it may be wrong: |
| 9 # All of the following RPC methods are invoked on the NPAPI thread from |
| 10 # untrusted code. This means, due to the Pepper threading model, that they |
| 11 # may only be invoked by code that is called from the JavaScript foreground |
| 12 # thread in the renderer. |
| 13 { |
| 14 'name': 'PpbGraphics3DRpc', |
| 15 'rpcs': [ |
| 16 # For PPB_Graphics3D.Create(...) |
| 17 {'name': 'PPB_Graphics3D_Create', |
| 18 'inputs': [['instance', 'PP_Instance'], |
| 19 ['share_context', 'PP_Resource'], |
| 20 ['attrib_list', 'int32_t[]'] |
| 21 ], |
| 22 'outputs': [['resource_id', 'PP_Resource'] |
| 23 ], |
| 24 }, |
| 25 # For PPB_Graphics3D.GetAttribs(...) |
| 26 {'name': 'PPB_Graphics3D_GetAttribs', |
| 27 'inputs': [['context', 'PP_Resource'], |
| 28 ['input_attrib_list', 'int32_t[]'] |
| 29 ], |
| 30 'outputs': [['output_attrib_list', 'int32_t[]'], |
| 31 ['pp_error', 'int32_t'] |
| 32 ], |
| 33 }, |
| 34 # For PPB_Graphics3D.SetAttribs(...) |
| 35 {'name': 'PPB_Graphics3D_SetAttribs', |
| 36 'inputs': [['context', 'PP_Resource'], |
| 37 ['attrib_list', 'int32_t[]'] |
| 38 ], |
| 39 'outputs': [['pp_error', 'int32_t'] |
| 40 ], |
| 41 }, |
| 42 # For PPB_Graphics3D.ResizeBuffers(...) |
| 43 {'name': 'PPB_Graphics3D_ResizeBuffers', |
| 44 'inputs': [['context', 'PP_Resource'], |
| 45 ['width', 'int32_t'], |
| 46 ['height', 'int32_t'] |
| 47 ], |
| 48 'outputs': [['pp_error', 'int32_t'] |
| 49 ], |
| 50 }, |
| 51 # For PPB_Graphics3D.SwapBuffers(...) |
| 52 {'name': 'PPB_Graphics3D_SwapBuffers', |
| 53 'inputs': [['context', 'PP_Resource'], |
| 54 ['callback_id', 'int32_t'] |
| 55 ], |
| 56 'outputs': [['pp_error', 'int32_t'] |
| 57 ], |
| 58 }, |
| 59 # End of PPB_Graphics3D. |
| 60 |
| 61 # Start of PPB_Graphics3DTrusted. |
| 62 # Create a Graphics3D context. |
| 63 {'name': 'PPB_Graphics3DTrusted_CreateRaw', |
| 64 'inputs': [['instance', 'PP_Instance'], |
| 65 ['share_context', 'PP_Resource'], |
| 66 ['attrib_list', 'int32_t[]'] |
| 67 ], |
| 68 'outputs': [['resource_id', 'PP_Resource']] |
| 69 }, |
| 70 # Initialize the command buffer. |
| 71 {'name': 'PPB_Graphics3DTrusted_InitCommandBuffer', |
| 72 'inputs': [['resource_id', 'PP_Resource'], |
| 73 ['size', 'int32_t'] |
| 74 ], |
| 75 'outputs': [['success', 'int32_t']] # PP_Bool |
| 76 }, |
| 77 # Get the ring buffer. |
| 78 {'name': 'PPB_Graphics3DTrusted_GetRingBuffer', |
| 79 'inputs': [['resource_id', 'PP_Resource']], |
| 80 'outputs': [['shm_desc', 'handle'], |
| 81 ['shm_size', 'int32_t'] |
| 82 ] |
| 83 }, |
| 84 # Get command buffer state. |
| 85 {'name': 'PPB_Graphics3DTrusted_GetState', |
| 86 'inputs': [['resource_id', 'PP_Resource']], |
| 87 'outputs': [['state', 'char[]'], # PP_Graphics3DTrustedState |
| 88 ] |
| 89 }, |
| 90 # Flush async. |
| 91 {'name': 'PPB_Graphics3DTrusted_Flush', |
| 92 'inputs': [['resource_id', 'PP_Resource'], |
| 93 ['put_offset', 'int32_t'] |
| 94 ], |
| 95 'outputs': [] |
| 96 }, |
| 97 # Flush sync. |
| 98 {'name': 'PPB_Graphics3DTrusted_FlushSync', |
| 99 'inputs': [['resource_id', 'PP_Resource'], |
| 100 ['put_offset', 'int32_t'] |
| 101 ], |
| 102 'outputs': [['state', 'char[]'], # PP_Graphics3DTrustedState |
| 103 ] |
| 104 }, |
| 105 # Create a shared memory transfer buffer. |
| 106 {'name': 'PPB_Graphics3DTrusted_CreateTransferBuffer', |
| 107 'inputs': [['resource_id', 'PP_Resource'], |
| 108 ['size', 'int32_t'], |
| 109 ['request_id', 'int32_t'] |
| 110 ], |
| 111 'outputs': [['id', 'int32_t']] |
| 112 }, |
| 113 # Destroy a shared memory transfer buffer. |
| 114 {'name': 'PPB_Graphics3DTrusted_DestroyTransferBuffer', |
| 115 'inputs': [['resource_id', 'PP_Resource'], |
| 116 ['id', 'int32_t'], |
| 117 ], |
| 118 'outputs': [] |
| 119 }, |
| 120 # Get a shared memory transfer buffer. |
| 121 {'name': 'PPB_Graphics3DTrusted_GetTransferBuffer', |
| 122 'inputs': [['resource_id', 'PP_Resource'], |
| 123 ['id', 'int32_t'], |
| 124 ], |
| 125 'outputs': [['shm_desc', 'handle'], |
| 126 ['shm_size', 'int32_t'] |
| 127 ] |
| 128 }, |
| 129 # End of PPB_Graphics3DTrusted |
| 130 ] |
| 131 } |
OLD | NEW |