OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains the command parser class. | 5 // This file contains the command parser class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ |
9 | 9 |
10 #include "gpu/command_buffer/common/constants.h" | 10 #include "gpu/command_buffer/common/constants.h" |
11 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 11 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
| 12 #include "gpu/gpu_export.h" |
12 | 13 |
13 namespace gpu { | 14 namespace gpu { |
14 | 15 |
15 class AsyncAPIInterface; | 16 class AsyncAPIInterface; |
16 | 17 |
17 // Command parser class. This class parses commands from a shared memory | 18 // Command parser class. This class parses commands from a shared memory |
18 // buffer, to implement some asynchronous RPC mechanism. | 19 // buffer, to implement some asynchronous RPC mechanism. |
19 class CommandParser { | 20 class GPU_EXPORT CommandParser { |
20 public: | 21 public: |
21 explicit CommandParser(AsyncAPIInterface* handler); | 22 explicit CommandParser(AsyncAPIInterface* handler); |
22 | 23 |
23 // Sets the buffer to read commands from. | 24 // Sets the buffer to read commands from. |
24 void SetBuffer( | 25 void SetBuffer( |
25 void* shm_address, | 26 void* shm_address, |
26 size_t shm_size, | 27 size_t shm_size, |
27 ptrdiff_t offset, | 28 ptrdiff_t offset, |
28 size_t size); | 29 size_t size); |
29 | 30 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 unsigned int arg_count, | 91 unsigned int arg_count, |
91 const void* cmd_data) = 0; | 92 const void* cmd_data) = 0; |
92 | 93 |
93 // Returns a name for a command. Useful for logging / debuging. | 94 // Returns a name for a command. Useful for logging / debuging. |
94 virtual const char* GetCommandName(unsigned int command_id) const = 0; | 95 virtual const char* GetCommandName(unsigned int command_id) const = 0; |
95 }; | 96 }; |
96 | 97 |
97 } // namespace gpu | 98 } // namespace gpu |
98 | 99 |
99 #endif // GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ | 100 #endif // GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ |
OLD | NEW |