OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/shared_memory.h" | 5 #include "base/shared_memory.h" |
6 #include "ipc/ipc_message_macros.h" | 6 #include "ipc/ipc_message_macros.h" |
7 | 7 |
8 IPC_BEGIN_MESSAGES(CommandBuffer) | 8 IPC_BEGIN_MESSAGES(CommandBuffer) |
9 // Initialize a command buffer with the given number of command entries. | 9 // Initialize a command buffer with the given number of command entries. |
10 // Returns the shared memory handle for the command buffer mapped to the | 10 // Returns the shared memory handle for the command buffer mapped to the |
11 // calling process. | 11 // calling process. |
12 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_Initialize, | 12 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_Initialize, |
13 int32 /* size */, | 13 int32 /* size */, |
14 base::SharedMemoryHandle /* ring_buffer */) | 14 base::SharedMemoryHandle /* ring_buffer */) |
15 | 15 |
16 // Get the number of command entries in the command buffer. | 16 // Get the current state of the command buffer, optionally reseting the |
17 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetSize, | 17 // parse error. |
18 int32 /* size */) | 18 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetState, |
| 19 gpu::CommandBuffer::State /* state */) |
19 | 20 |
20 // Synchronize the put and get offsets of both processes. Caller passes its | 21 // Synchronize the put and get offsets of both processes. Caller passes its |
21 // current put offset. Current get offset is returned. | 22 // current put offset. Current get offset is returned. |
22 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_SyncOffsets, | 23 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_Flush, |
23 int32 /* put_offset */, | 24 int32 /* put_offset */, |
24 int32 /* get_offset */) | 25 gpu::CommandBuffer::State /* state */) |
25 | |
26 // Get the current get offset. | |
27 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetGetOffset, | |
28 int32 /* get_offset */) | |
29 | |
30 // Get the current put offset. | |
31 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetPutOffset, | |
32 int32 /* put_offset */) | |
33 | 26 |
34 // Create a shared memory transfer buffer. Returns an id that can be used to | 27 // Create a shared memory transfer buffer. Returns an id that can be used to |
35 // identify the transfer buffer from a comment. | 28 // identify the transfer buffer from a comment. |
36 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_CreateTransferBuffer, | 29 IPC_SYNC_MESSAGE_ROUTED1_1(CommandBufferMsg_CreateTransferBuffer, |
37 int32 /* size */, | 30 int32 /* size */, |
38 int32 /* id */) | 31 int32 /* id */) |
39 | 32 |
40 // Destroy a previously created transfer buffer. | 33 // Destroy a previously created transfer buffer. |
41 IPC_SYNC_MESSAGE_ROUTED1_0(CommandBufferMsg_DestroyTransferBuffer, | 34 IPC_SYNC_MESSAGE_ROUTED1_0(CommandBufferMsg_DestroyTransferBuffer, |
42 int32 /* id */) | 35 int32 /* id */) |
43 | 36 |
44 // Get the shared memory handle for a transfer buffer mapped to the callers | 37 // Get the shared memory handle for a transfer buffer mapped to the callers |
45 // process. | 38 // process. |
46 IPC_SYNC_MESSAGE_ROUTED1_2(CommandBufferMsg_GetTransferBuffer, | 39 IPC_SYNC_MESSAGE_ROUTED1_2(CommandBufferMsg_GetTransferBuffer, |
47 int32 /* id */, | 40 int32 /* id */, |
48 base::SharedMemoryHandle /* transfer_buffer */, | 41 base::SharedMemoryHandle /* transfer_buffer */, |
49 size_t /* size */) | 42 size_t /* size */) |
50 | 43 |
51 // Get the most recently processed token. Used for implementing fences. | |
52 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetToken, | |
53 int32 /* token */) | |
54 | |
55 // Get the current parse error. Calling this resets the parse error if it is | |
56 // recoverable. | |
57 // TODO(apatrick): Switch to the parse_error::ParseError enum now that NPAPI | |
58 // no longer limits to restricted set of datatypes. | |
59 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_ResetParseError, | |
60 int32 /* parse_error */) | |
61 | |
62 // Get the current error status. | |
63 IPC_SYNC_MESSAGE_ROUTED0_1(CommandBufferMsg_GetErrorStatus, | |
64 bool /* status */) | |
65 | |
66 IPC_END_MESSAGES(CommandBuffer) | 44 IPC_END_MESSAGES(CommandBuffer) |
OLD | NEW |