OLD | NEW |
1 // Copyright (c) 2012 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 <stddef.h> |
| 11 #include <stdint.h> |
| 12 |
| 13 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
10 #include "gpu/command_buffer/common/constants.h" | 14 #include "gpu/command_buffer/common/constants.h" |
11 #include "gpu/command_buffer/common/cmd_buffer_common.h" | |
12 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
13 | 16 |
14 namespace gpu { | 17 namespace gpu { |
15 | 18 |
16 class AsyncAPIInterface; | 19 class AsyncAPIInterface; |
17 | 20 |
18 // Command parser class. This class parses commands from a shared memory | 21 // Command parser class. This class parses commands from a shared memory |
19 // buffer, to implement some asynchronous RPC mechanism. | 22 // buffer, to implement some asynchronous RPC mechanism. |
20 class GPU_EXPORT CommandParser { | 23 class GPU_EXPORT CommandParser { |
21 public: | 24 public: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // if there are no commands in the buffer. | 62 // if there are no commands in the buffer. |
60 error::Error ProcessCommands(int num_commands); | 63 error::Error ProcessCommands(int num_commands); |
61 | 64 |
62 // Processes all commands until get == put. | 65 // Processes all commands until get == put. |
63 error::Error ProcessAllCommands(); | 66 error::Error ProcessAllCommands(); |
64 | 67 |
65 private: | 68 private: |
66 CommandBufferOffset get_; | 69 CommandBufferOffset get_; |
67 CommandBufferOffset put_; | 70 CommandBufferOffset put_; |
68 CommandBufferEntry* buffer_; | 71 CommandBufferEntry* buffer_; |
69 int32 entry_count_; | 72 int32_t entry_count_; |
70 AsyncAPIInterface* handler_; | 73 AsyncAPIInterface* handler_; |
71 }; | 74 }; |
72 | 75 |
73 // This class defines the interface for an asynchronous API handler, that | 76 // This class defines the interface for an asynchronous API handler, that |
74 // is responsible for de-multiplexing commands and their arguments. | 77 // is responsible for de-multiplexing commands and their arguments. |
75 class GPU_EXPORT AsyncAPIInterface { | 78 class GPU_EXPORT AsyncAPIInterface { |
76 public: | 79 public: |
77 AsyncAPIInterface() {} | 80 AsyncAPIInterface() {} |
78 virtual ~AsyncAPIInterface() {} | 81 virtual ~AsyncAPIInterface() {} |
79 | 82 |
(...skipping 21 matching lines...) Expand all Loading... |
101 int num_entries, | 104 int num_entries, |
102 int* entries_processed); | 105 int* entries_processed); |
103 | 106 |
104 // Returns a name for a command. Useful for logging / debuging. | 107 // Returns a name for a command. Useful for logging / debuging. |
105 virtual const char* GetCommandName(unsigned int command_id) const = 0; | 108 virtual const char* GetCommandName(unsigned int command_id) const = 0; |
106 }; | 109 }; |
107 | 110 |
108 } // namespace gpu | 111 } // namespace gpu |
109 | 112 |
110 #endif // GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ | 113 #endif // GPU_COMMAND_BUFFER_SERVICE_CMD_PARSER_H_ |
OLD | NEW |