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

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

Issue 846943002: Improve BindBufferBase/BindBufferRange and a few other commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « gpu/command_buffer/client/share_group.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CONTEXT_GROUP_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void LoseContexts(GLenum reset_status); 170 void LoseContexts(GLenum reset_status);
171 171
172 // EXT_draw_buffer related states for backbuffer. 172 // EXT_draw_buffer related states for backbuffer.
173 GLenum draw_buffer() const { 173 GLenum draw_buffer() const {
174 return draw_buffer_; 174 return draw_buffer_;
175 } 175 }
176 void set_draw_buffer(GLenum buf) { 176 void set_draw_buffer(GLenum buf) {
177 draw_buffer_ = buf; 177 draw_buffer_ = buf;
178 } 178 }
179 179
180 void AddBufferId(GLuint client_id, GLuint service_id) { 180 bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const;
181 buffers_id_map_[client_id] = service_id;
182 }
183
184 bool GetBufferServiceId(GLuint client_id, GLuint* service_id) const {
185 std::map<GLuint, GLuint>::const_iterator iter =
186 buffers_id_map_.find(client_id);
187 if (iter == buffers_id_map_.end())
188 return false;
189 if (service_id)
190 *service_id = iter->second;
191 return true;
192 }
193
194 void RemoveBufferId(GLuint client_id) {
195 buffers_id_map_.erase(client_id);
196 }
197 181
198 void AddSamplerId(GLuint client_id, GLuint service_id) { 182 void AddSamplerId(GLuint client_id, GLuint service_id) {
199 samplers_id_map_[client_id] = service_id; 183 samplers_id_map_[client_id] = service_id;
200 } 184 }
201 185
202 bool GetSamplerServiceId(GLuint client_id, GLuint* service_id) const { 186 bool GetSamplerServiceId(GLuint client_id, GLuint* service_id) const {
203 std::map<GLuint, GLuint>::const_iterator iter = 187 std::map<GLuint, GLuint>::const_iterator iter =
204 samplers_id_map_.find(client_id); 188 samplers_id_map_.find(client_id);
205 if (iter == samplers_id_map_.end()) 189 if (iter == samplers_id_map_.end())
206 return false; 190 return false;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 260
277 scoped_ptr<ShaderManager> shader_manager_; 261 scoped_ptr<ShaderManager> shader_manager_;
278 262
279 scoped_ptr<ValuebufferManager> valuebuffer_manager_; 263 scoped_ptr<ValuebufferManager> valuebuffer_manager_;
280 264
281 scoped_refptr<FeatureInfo> feature_info_; 265 scoped_refptr<FeatureInfo> feature_info_;
282 266
283 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; 267 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
284 268
285 // Mappings from client side IDs to service side IDs. 269 // Mappings from client side IDs to service side IDs.
286 std::map<GLuint, GLuint> buffers_id_map_;
287 std::map<GLuint, GLuint> samplers_id_map_; 270 std::map<GLuint, GLuint> samplers_id_map_;
288 std::map<GLuint, GLuint> transformfeedbacks_id_map_; 271 std::map<GLuint, GLuint> transformfeedbacks_id_map_;
289 272
290 GLenum draw_buffer_; 273 GLenum draw_buffer_;
291 274
292 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 275 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
293 }; 276 };
294 277
295 } // namespace gles2 278 } // namespace gles2
296 } // namespace gpu 279 } // namespace gpu
297 280
298 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 281 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
299 282
300 283
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/share_group.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698