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

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

Issue 795243002: Add TransformFeedback related APIs to command buffer: PART I. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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_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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return false; 186 return false;
187 if (service_id) 187 if (service_id)
188 *service_id = iter->second; 188 *service_id = iter->second;
189 return true; 189 return true;
190 } 190 }
191 191
192 void RemoveSamplerId(GLuint client_id) { 192 void RemoveSamplerId(GLuint client_id) {
193 samplers_id_map_.erase(client_id); 193 samplers_id_map_.erase(client_id);
194 } 194 }
195 195
196 void AddTransformFeedbackId(GLuint client_id, GLuint service_id) {
197 transformfeedbacks_id_map_[client_id] = service_id;
198 }
199
200 bool GetTransformFeedbackServiceId(
201 GLuint client_id, GLuint* service_id) const {
202 std::map<GLuint, GLuint>::const_iterator iter =
203 transformfeedbacks_id_map_.find(client_id);
204 if (iter == transformfeedbacks_id_map_.end())
205 return false;
206 if (service_id)
207 *service_id = iter->second;
208 return true;
209 }
210
211 void RemoveTransformFeedbackId(GLuint client_id) {
212 transformfeedbacks_id_map_.erase(client_id);
213 }
214
196 private: 215 private:
197 friend class base::RefCounted<ContextGroup>; 216 friend class base::RefCounted<ContextGroup>;
198 ~ContextGroup(); 217 ~ContextGroup();
199 218
200 bool CheckGLFeature(GLint min_required, GLint* v); 219 bool CheckGLFeature(GLint min_required, GLint* v);
201 bool CheckGLFeatureU(GLint min_required, uint32* v); 220 bool CheckGLFeatureU(GLint min_required, uint32* v);
202 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); 221 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v);
203 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); 222 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v);
204 bool HaveContexts(); 223 bool HaveContexts();
205 224
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 scoped_ptr<ShaderManager> shader_manager_; 256 scoped_ptr<ShaderManager> shader_manager_;
238 257
239 scoped_ptr<ValuebufferManager> valuebuffer_manager_; 258 scoped_ptr<ValuebufferManager> valuebuffer_manager_;
240 259
241 scoped_refptr<FeatureInfo> feature_info_; 260 scoped_refptr<FeatureInfo> feature_info_;
242 261
243 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; 262 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
244 263
245 // Mappings from client side IDs to service side IDs. 264 // Mappings from client side IDs to service side IDs.
246 std::map<GLuint, GLuint> samplers_id_map_; 265 std::map<GLuint, GLuint> samplers_id_map_;
266 std::map<GLuint, GLuint> transformfeedbacks_id_map_;
247 267
248 GLenum draw_buffer_; 268 GLenum draw_buffer_;
249 269
250 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 270 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
251 }; 271 };
252 272
253 } // namespace gles2 273 } // namespace gles2
254 } // namespace gpu 274 } // namespace gpu
255 275
256 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 276 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
257 277
258 278
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698