| 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/dev/ppb_context_3d_dev.h" | 8 #include "ppapi/c/dev/ppb_context_3d_dev.h" |
| 9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
| 13 | 13 |
| 14 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE_0_3 "PPB_Context3DTrusted(Dev);0.3" | 14 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE_0_4 "PPB_Context3DTrusted(Dev);0.4" |
| 15 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE \ | 15 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE \ |
| 16 PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE_0_3 | 16 PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE_0_4 |
| 17 | 17 |
| 18 typedef enum { | 18 typedef enum { |
| 19 kNoError, | 19 kNoError, |
| 20 kInvalidSize, | 20 kInvalidSize, |
| 21 kOutOfBounds, | 21 kOutOfBounds, |
| 22 kUnknownCommand, | 22 kUnknownCommand, |
| 23 kInvalidArguments, | 23 kInvalidArguments, |
| 24 kLostContext, | 24 kLostContext, |
| 25 kGenericError | 25 kGenericError |
| 26 } PPB_Context3DTrustedError; | 26 } PPB_Context3DTrustedError; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // The current token value. This is used by the writer to defer | 38 // The current token value. This is used by the writer to defer |
| 39 // changes to shared memory objects until the reader has reached a certain | 39 // changes to shared memory objects until the reader has reached a certain |
| 40 // point in the command buffer. The reader is responsible for updating the | 40 // point in the command buffer. The reader is responsible for updating the |
| 41 // token value, for example in response to an asynchronous set token command | 41 // token value, for example in response to an asynchronous set token command |
| 42 // embedded in the command buffer. The default token value is zero. | 42 // embedded in the command buffer. The default token value is zero. |
| 43 int32_t token; | 43 int32_t token; |
| 44 | 44 |
| 45 // Error status. | 45 // Error status. |
| 46 PPB_Context3DTrustedError error; | 46 PPB_Context3DTrustedError error; |
| 47 |
| 48 // Generation index of this state. The generation index is incremented every |
| 49 // time a new state is retrieved from the command processor, so that |
| 50 // consistency can be kept even if IPC messages are processed out-of-order. |
| 51 uint32_t generation; |
| 47 }; | 52 }; |
| 48 | 53 |
| 49 struct PPB_Context3DTrusted_Dev { | 54 struct PPB_Context3DTrusted_Dev { |
| 50 // Creates a raw Context3D resource. A raw Context3D is intended to be used | 55 // Creates a raw Context3D resource. A raw Context3D is intended to be used |
| 51 // with the trusted interface, through the command buffer (for proxying). In | 56 // with the trusted interface, through the command buffer (for proxying). In |
| 52 // particular, when a Surface3D is bound to a raw context, SwapBuffers has no | 57 // particular, when a Surface3D is bound to a raw context, SwapBuffers has no |
| 53 // effect. | 58 // effect. |
| 54 PP_Resource (*CreateRaw)(PP_Instance instance_id, | 59 PP_Resource (*CreateRaw)(PP_Instance instance_id, |
| 55 PP_Config3D_Dev config, | 60 PP_Config3D_Dev config, |
| 56 PP_Resource share_context, | 61 PP_Resource share_context, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 82 int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_t size); | 87 int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_t size); |
| 83 | 88 |
| 84 // Destroy a transfer buffer and recycle the handle. | 89 // Destroy a transfer buffer and recycle the handle. |
| 85 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); | 90 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); |
| 86 | 91 |
| 87 // Get the transfer buffer associated with a handle. | 92 // Get the transfer buffer associated with a handle. |
| 88 PP_Bool (*GetTransferBuffer)(PP_Resource context, | 93 PP_Bool (*GetTransferBuffer)(PP_Resource context, |
| 89 int32_t id, | 94 int32_t id, |
| 90 int* shm_handle, | 95 int* shm_handle, |
| 91 uint32_t* shm_size); | 96 uint32_t* shm_size); |
| 97 |
| 98 // Like FlushSync, but returns before processing commands if the get offset is |
| 99 // different than last_known_get. Allows synchronization with the command |
| 100 // processor without forcing immediate command execution. |
| 101 struct PP_Context3DTrustedState (*FlushSyncFast)(PP_Resource context, |
| 102 int32_t put_offset, |
| 103 int32_t last_known_get); |
| 92 }; | 104 }; |
| 93 | 105 |
| 94 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 106 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
| 95 | 107 |
| OLD | NEW |