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 "PPB_Context3DTrusted(Dev);0.2" | 14 #define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.2" |
15 | 15 |
16 enum PPB_Context3DTrustedError { | 16 typedef enum { |
17 kNoError, | 17 kNoError, |
18 kInvalidSize, | 18 kInvalidSize, |
19 kOutOfBounds, | 19 kOutOfBounds, |
20 kUnknownCommand, | 20 kUnknownCommand, |
21 kInvalidArguments, | 21 kInvalidArguments, |
22 kLostContext, | 22 kLostContext, |
23 kGenericError | 23 kGenericError |
24 }; | 24 } PPB_Context3DTrustedError; |
25 | 25 |
26 struct PP_Context3DTrustedState { | 26 struct PP_Context3DTrustedState { |
27 // Size of the command buffer in command buffer entries. | 27 // Size of the command buffer in command buffer entries. |
28 int32_t num_entries; | 28 int32_t num_entries; |
29 | 29 |
30 // The offset (in entries) from which the reader is reading. | 30 // The offset (in entries) from which the reader is reading. |
31 int32_t get_offset; | 31 int32_t get_offset; |
32 | 32 |
33 // The offset (in entries) at which the writer is writing. | 33 // The offset (in entries) at which the writer is writing. |
34 int32_t put_offset; | 34 int32_t put_offset; |
(...skipping 21 matching lines...) Expand all Loading... |
56 | 56 |
57 // Initializes the command buffer with the given size. | 57 // Initializes the command buffer with the given size. |
58 PP_Bool (*Initialize)(PP_Resource context_id, int32_t size); | 58 PP_Bool (*Initialize)(PP_Resource context_id, int32_t size); |
59 | 59 |
60 // Gets the ring buffer for the command buffer. | 60 // Gets the ring buffer for the command buffer. |
61 PP_Bool (*GetRingBuffer)(PP_Resource context_id, | 61 PP_Bool (*GetRingBuffer)(PP_Resource context_id, |
62 int* shm_handle, | 62 int* shm_handle, |
63 uint32_t* shm_size); | 63 uint32_t* shm_size); |
64 | 64 |
65 // Returns the current state. | 65 // Returns the current state. |
66 PP_Context3DTrustedState (*GetState)(PP_Resource context); | 66 struct PP_Context3DTrustedState (*GetState)(PP_Resource context); |
67 | 67 |
68 // The writer calls this to update its put offset. | 68 // The writer calls this to update its put offset. |
69 PP_Bool (*Flush)(PP_Resource context, int32_t put_offset); | 69 PP_Bool (*Flush)(PP_Resource context, int32_t put_offset); |
70 | 70 |
71 | 71 |
72 // The writer calls this to update its put offset. This function returns the | 72 // The writer calls this to update its put offset. This function returns the |
73 // reader's most recent get offset. Does not return until after the put offset | 73 // reader's most recent get offset. Does not return until after the put offset |
74 // change callback has been invoked. | 74 // change callback has been invoked. |
75 PP_Context3DTrustedState (*FlushSync)(PP_Resource context, | 75 struct PP_Context3DTrustedState (*FlushSync)(PP_Resource context, |
76 int32_t put_offset); | 76 int32_t put_offset); |
77 | 77 |
78 // Create a transfer buffer and return a handle that uniquely | 78 // Create a transfer buffer and return a handle that uniquely |
79 // identifies it or -1 on error. | 79 // identifies it or -1 on error. |
80 int32_t (*CreateTransferBuffer)(PP_Resource context, size_t size); | 80 int32_t (*CreateTransferBuffer)(PP_Resource context, size_t size); |
81 | 81 |
82 // Destroy a transfer buffer and recycle the handle. | 82 // Destroy a transfer buffer and recycle the handle. |
83 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); | 83 PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); |
84 | 84 |
85 // Get the transfer buffer associated with a handle. | 85 // Get the transfer buffer associated with a handle. |
86 PP_Bool (*GetTransferBuffer)(PP_Resource context, | 86 PP_Bool (*GetTransferBuffer)(PP_Resource context, |
87 int32_t id, | 87 int32_t id, |
88 int* shm_handle, | 88 int* shm_handle, |
89 uint32_t* shm_size); | 89 uint32_t* shm_size); |
90 }; | 90 }; |
91 | 91 |
92 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ | 92 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_TRUSTED_DEV_H_ |
93 | 93 |
OLD | NEW |