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