| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
| 10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
| 11 | 11 |
| 12 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.1" | 12 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.2" |
| 13 | 13 |
| 14 enum PPB_Context3DTrustedError { | 14 enum PPB_Context3DTrustedError { |
| 15 kNoError, | 15 kNoError, |
| 16 kInvalidSize, | 16 kInvalidSize, |
| 17 kOutOfBounds, | 17 kOutOfBounds, |
| 18 kUnknownCommand, | 18 kUnknownCommand, |
| 19 kInvalidArguments, | 19 kInvalidArguments, |
| 20 kLostContext, | 20 kLostContext, |
| 21 kGenericError | 21 kGenericError |
| 22 }; | 22 }; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 // point in the command buffer. The reader is responsible for updating the | 36 // point in the command buffer. The reader is responsible for updating the |
| 37 // token value, for example in response to an asynchronous set token command | 37 // token value, for example in response to an asynchronous set token command |
| 38 // embedded in the command buffer. The default token value is zero. | 38 // embedded in the command buffer. The default token value is zero. |
| 39 int32_t token; | 39 int32_t token; |
| 40 | 40 |
| 41 // Error status. | 41 // Error status. |
| 42 PPB_Context3DTrustedError error; | 42 PPB_Context3DTrustedError error; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 struct PPB_Context3DTrusted_Dev { | 45 struct PPB_Context3DTrusted_Dev { |
| 46 // Creates a raw Context3D resource. A raw Context3D is intended to be used |
| 47 // with the trusted interface, through the command buffer (for proxying). In |
| 48 // particular, when a Surface3D is bound to a raw context, SwapBuffers has no |
| 49 // effect. |
| 50 PP_Resource (*CreateRaw)(PP_Instance instance_id, |
| 51 PP_Config3D_Dev config, |
| 52 PP_Resource share_context, |
| 53 const int32_t* attrib_list); |
| 54 |
| 55 // Initializes the command buffer with the given size. |
| 56 PP_Bool (*Initialize)(PP_Resource context_id, int32_t size); |
| 57 |
| 58 // Gets the ring buffer for the command buffer. |
| 46 PP_Bool (*GetRingBuffer)(PP_Resource context_id, | 59 PP_Bool (*GetRingBuffer)(PP_Resource context_id, |
| 47 int* shm_handle, | 60 int* shm_handle, |
| 48 uint32_t* shm_size); | 61 uint32_t* shm_size); |
| 49 | 62 |
| 50 // Returns the current state. | 63 // Returns the current state. |
| 51 PP_Context3DTrustedState (*GetState)(PP_Resource context); | 64 PP_Context3DTrustedState (*GetState)(PP_Resource context); |
| 52 | 65 |
| 53 // The writer calls this to update its put offset. | 66 // The writer calls this to update its put offset. |
| 54 PP_Bool (*Flush)(PP_Resource context, int32_t put_offset); | 67 PP_Bool (*Flush)(PP_Resource context, int32_t put_offset); |
| 55 | 68 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 69 | 82 |
| 70 // Get the transfer buffer associated with a handle. | 83 // Get the transfer buffer associated with a handle. |
| 71 PP_Bool (*GetTransferBuffer)(PP_Resource context, | 84 PP_Bool (*GetTransferBuffer)(PP_Resource context, |
| 72 int32_t id, | 85 int32_t id, |
| 73 int* shm_handle, | 86 int* shm_handle, |
| 74 uint32_t* shm_size); | 87 uint32_t* shm_size); |
| 75 }; | 88 }; |
| 76 | 89 |
| 77 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 90 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
| 78 | 91 |
| OLD | NEW |