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" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 // The current token value. This is used by the writer to defer | 36 // The current token value. This is used by the writer to defer |
37 // changes to shared memory objects until the reader has reached a certain | 37 // changes to shared memory objects until the reader has reached a certain |
38 // point in the command buffer. The reader is responsible for updating the | 38 // point in the command buffer. The reader is responsible for updating the |
39 // token value, for example in response to an asynchronous set token command | 39 // token value, for example in response to an asynchronous set token command |
40 // embedded in the command buffer. The default token value is zero. | 40 // embedded in the command buffer. The default token value is zero. |
41 int32_t token; | 41 int32_t token; |
42 | 42 |
43 // Error status. | 43 // Error status. |
44 PPB_Context3DTrustedError error; | 44 PPB_Context3DTrustedError error; |
45 | |
46 // Generation index of this state. The generation index is incremented every | |
47 // time a new state is retrieved from the command processor, so that | |
48 // consistency can be kept even if IPC messages are processed out-of-order. | |
49 uint32_t generation; | |
45 }; | 50 }; |
46 | 51 |
47 struct PPB_Context3DTrusted_Dev { | 52 struct PPB_Context3DTrusted_Dev { |
48 // Creates a raw Context3D resource. A raw Context3D is intended to be used | 53 // Creates a raw Context3D resource. A raw Context3D is intended to be used |
49 // with the trusted interface, through the command buffer (for proxying). In | 54 // with the trusted interface, through the command buffer (for proxying). In |
50 // particular, when a Surface3D is bound to a raw context, SwapBuffers has no | 55 // particular, when a Surface3D is bound to a raw context, SwapBuffers has no |
51 // effect. | 56 // effect. |
52 PP_Resource (*CreateRaw)(PP_Instance instance_id, | 57 PP_Resource (*CreateRaw)(PP_Instance instance_id, |
53 PP_Config3D_Dev config, | 58 PP_Config3D_Dev config, |
54 PP_Resource share_context, | 59 PP_Resource share_context, |
(...skipping 25 matching lines...) Expand all Loading... | |
80 int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_t size); | 85 int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_t size); |
81 | 86 |
82 // Destroy a transfer buffer and recycle the handle. | 87 // Destroy a transfer buffer and recycle the handle. |
83 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); | 88 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); |
84 | 89 |
85 // Get the transfer buffer associated with a handle. | 90 // Get the transfer buffer associated with a handle. |
86 PP_Bool (*GetTransferBuffer)(PP_Resource context, | 91 PP_Bool (*GetTransferBuffer)(PP_Resource context, |
87 int32_t id, | 92 int32_t id, |
88 int* shm_handle, | 93 int* shm_handle, |
89 uint32_t* shm_size); | 94 uint32_t* shm_size); |
95 | |
96 // Like FlushSync, but returns before processing commands if the get offset is | |
97 // different than last_known_get. Allows synchronization with the command | |
98 // processor without forcing immediate command execution. | |
99 struct PP_Context3DTrustedState (*FlushSyncFast)(PP_Resource context, | |
piman
2011/04/27 21:28:39
This was added instead of replacing FlushSync beca
| |
100 int32_t put_offset, | |
101 int32_t last_known_get); | |
90 }; | 102 }; |
91 | 103 |
92 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 104 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
93 | 105 |
OLD | NEW |