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 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 CommonDecoder(); | 96 CommonDecoder(); |
97 virtual ~CommonDecoder(); | 97 virtual ~CommonDecoder(); |
98 | 98 |
99 // Sets the engine, to get shared memory buffers from, and to set the token | 99 // Sets the engine, to get shared memory buffers from, and to set the token |
100 // to. | 100 // to. |
101 void set_engine(CommandBufferEngine* engine) { | 101 void set_engine(CommandBufferEngine* engine) { |
102 engine_ = engine; | 102 engine_ = engine; |
103 } | 103 } |
104 | 104 |
| 105 // Creates a bucket. If the bucket already exists returns that bucket. |
| 106 Bucket* CreateBucket(uint32 bucket_id); |
| 107 |
105 // Gets a bucket. Returns NULL if the bucket does not exist. | 108 // Gets a bucket. Returns NULL if the bucket does not exist. |
106 Bucket* GetBucket(uint32 bucket_id) const; | 109 Bucket* GetBucket(uint32 bucket_id) const; |
107 | 110 |
108 // Gets the address of shared memory data, given a shared memory ID and an | 111 // Gets the address of shared memory data, given a shared memory ID and an |
109 // offset. Also checks that the size is consistent with the shared memory | 112 // offset. Also checks that the size is consistent with the shared memory |
110 // size. | 113 // size. |
111 // Parameters: | 114 // Parameters: |
112 // shm_id: the id of the shared memory buffer. | 115 // shm_id: the id of the shared memory buffer. |
113 // offset: the offset of the data in the shared memory buffer. | 116 // offset: the offset of the data in the shared memory buffer. |
114 // size: the size of the data. | 117 // size: the size of the data. |
(...skipping 21 matching lines...) Expand all Loading... |
136 // error::kNoError if no error was found, one of | 139 // error::kNoError if no error was found, one of |
137 // error::Error otherwise. | 140 // error::Error otherwise. |
138 error::Error DoCommonCommand( | 141 error::Error DoCommonCommand( |
139 unsigned int command, | 142 unsigned int command, |
140 unsigned int arg_count, | 143 unsigned int arg_count, |
141 const void* cmd_data); | 144 const void* cmd_data); |
142 | 145 |
143 // Gets an name for a common command. | 146 // Gets an name for a common command. |
144 const char* GetCommonCommandName(cmd::CommandId command_id) const; | 147 const char* GetCommonCommandName(cmd::CommandId command_id) const; |
145 | 148 |
146 // Creates a bucket. If the bucket already exists returns that bucket. | |
147 Bucket* CreateBucket(uint32 bucket_id); | |
148 | |
149 private: | 149 private: |
150 // Generate a member function prototype for each command in an automated and | 150 // Generate a member function prototype for each command in an automated and |
151 // typesafe way. | 151 // typesafe way. |
152 #define COMMON_COMMAND_BUFFER_CMD_OP(name) \ | 152 #define COMMON_COMMAND_BUFFER_CMD_OP(name) \ |
153 error::Error Handle##name( \ | 153 error::Error Handle##name( \ |
154 uint32 immediate_data_size, \ | 154 uint32 immediate_data_size, \ |
155 const cmd::name& args); \ | 155 const cmd::name& args); \ |
156 | 156 |
157 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) | 157 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) |
158 | 158 |
(...skipping 15 matching lines...) Expand all Loading... |
174 | 174 |
175 uint32 offset; | 175 uint32 offset; |
176 }; | 176 }; |
177 std::stack<CommandAddress> call_stack_; | 177 std::stack<CommandAddress> call_stack_; |
178 }; | 178 }; |
179 | 179 |
180 } // namespace gpu | 180 } // namespace gpu |
181 | 181 |
182 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ | 182 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ |
183 | 183 |
OLD | NEW |