Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: gpu/command_buffer/service/common_decoder.h

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Introduced internal SetAsyncToken command buffer command Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 template <typename T> 128 template <typename T>
129 T GetSharedMemoryAs(unsigned int shm_id, unsigned int offset, 129 T GetSharedMemoryAs(unsigned int shm_id, unsigned int offset,
130 unsigned int size) { 130 unsigned int size) {
131 return static_cast<T>(GetAddressAndCheckSize(shm_id, offset, size)); 131 return static_cast<T>(GetAddressAndCheckSize(shm_id, offset, size));
132 } 132 }
133 133
134 // Get the actual shared memory buffer. 134 // Get the actual shared memory buffer.
135 Buffer GetSharedMemoryBuffer(unsigned int shm_id); 135 Buffer GetSharedMemoryBuffer(unsigned int shm_id);
136 136
137 protected: 137 protected:
138 virtual void OnSetAsyncToken(uint32 async_token) {
139 // This should only happen when this function is overriden.
140 NOTREACHED();
141 }
142
138 // Executes a common command. 143 // Executes a common command.
139 // Parameters: 144 // Parameters:
140 // command: the command index. 145 // command: the command index.
141 // arg_count: the number of CommandBufferEntry arguments. 146 // arg_count: the number of CommandBufferEntry arguments.
142 // cmd_data: the command data. 147 // cmd_data: the command data.
143 // Returns: 148 // Returns:
144 // error::kNoError if no error was found, one of 149 // error::kNoError if no error was found, one of
145 // error::Error otherwise. 150 // error::Error otherwise.
146 error::Error DoCommonCommand( 151 error::Error DoCommonCommand(
147 unsigned int command, 152 unsigned int command,
(...skipping 18 matching lines...) Expand all
166 CommandBufferEngine* engine_; 171 CommandBufferEngine* engine_;
167 172
168 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap; 173 typedef std::map<uint32, linked_ptr<Bucket> > BucketMap;
169 BucketMap buckets_; 174 BucketMap buckets_;
170 }; 175 };
171 176
172 } // namespace gpu 177 } // namespace gpu
173 178
174 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_ 179 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMON_DECODER_H_
175 180
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698