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

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

Issue 859043005: Add Sync related APIs to GPU command buffer: Part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return false; 209 return false;
210 if (service_id) 210 if (service_id)
211 *service_id = iter->second; 211 *service_id = iter->second;
212 return true; 212 return true;
213 } 213 }
214 214
215 void RemoveTransformFeedbackId(GLuint client_id) { 215 void RemoveTransformFeedbackId(GLuint client_id) {
216 transformfeedbacks_id_map_.erase(client_id); 216 transformfeedbacks_id_map_.erase(client_id);
217 } 217 }
218 218
219 void AddSyncId(GLuint client_id, GLsync service_id) {
220 syncs_id_map_[client_id] = service_id;
221 }
222
223 bool GetSyncServiceId(GLuint client_id, GLsync* service_id) const {
224 std::map<GLuint, GLsync>::const_iterator iter =
225 syncs_id_map_.find(client_id);
226 if (iter == syncs_id_map_.end())
227 return false;
228 if (service_id)
229 *service_id = iter->second;
230 return true;
231 }
232
233 void RemoveSyncId(GLuint client_id) {
234 syncs_id_map_.erase(client_id);
235 }
236
219 private: 237 private:
220 friend class base::RefCounted<ContextGroup>; 238 friend class base::RefCounted<ContextGroup>;
221 ~ContextGroup(); 239 ~ContextGroup();
222 240
223 bool CheckGLFeature(GLint min_required, GLint* v); 241 bool CheckGLFeature(GLint min_required, GLint* v);
224 bool CheckGLFeatureU(GLint min_required, uint32* v); 242 bool CheckGLFeatureU(GLint min_required, uint32* v);
225 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); 243 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v);
226 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); 244 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v);
227 bool HaveContexts(); 245 bool HaveContexts();
228 246
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 280
263 scoped_ptr<ValuebufferManager> valuebuffer_manager_; 281 scoped_ptr<ValuebufferManager> valuebuffer_manager_;
264 282
265 scoped_refptr<FeatureInfo> feature_info_; 283 scoped_refptr<FeatureInfo> feature_info_;
266 284
267 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; 285 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
268 286
269 // Mappings from client side IDs to service side IDs. 287 // Mappings from client side IDs to service side IDs.
270 std::map<GLuint, GLuint> samplers_id_map_; 288 std::map<GLuint, GLuint> samplers_id_map_;
271 std::map<GLuint, GLuint> transformfeedbacks_id_map_; 289 std::map<GLuint, GLuint> transformfeedbacks_id_map_;
290 std::map<GLuint, GLsync> syncs_id_map_;
piman 2015/01/22 00:49:32 nit: by the way, could all these be hash_maps inst
Zhenyao Mo 2015/01/22 01:12:57 Done.
272 291
273 GLenum draw_buffer_; 292 GLenum draw_buffer_;
274 293
275 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 294 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
276 }; 295 };
277 296
278 } // namespace gles2 297 } // namespace gles2
279 } // namespace gpu 298 } // namespace gpu
280 299
281 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 300 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
282 301
283 302
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698