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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/context_group.h
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h
index 8eeaf531d66eb2aececf708772220cf663e2ab6f..afb36af74f50b490e9950ef4e8b37c8994d38e83 100644
--- a/gpu/command_buffer/service/context_group.h
+++ b/gpu/command_buffer/service/context_group.h
@@ -216,6 +216,24 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
transformfeedbacks_id_map_.erase(client_id);
}
+ void AddSyncId(GLuint client_id, GLsync service_id) {
+ syncs_id_map_[client_id] = service_id;
+ }
+
+ bool GetSyncServiceId(GLuint client_id, GLsync* service_id) const {
+ std::map<GLuint, GLsync>::const_iterator iter =
+ syncs_id_map_.find(client_id);
+ if (iter == syncs_id_map_.end())
+ return false;
+ if (service_id)
+ *service_id = iter->second;
+ return true;
+ }
+
+ void RemoveSyncId(GLuint client_id) {
+ syncs_id_map_.erase(client_id);
+ }
+
private:
friend class base::RefCounted<ContextGroup>;
~ContextGroup();
@@ -269,6 +287,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
// Mappings from client side IDs to service side IDs.
std::map<GLuint, GLuint> samplers_id_map_;
std::map<GLuint, GLuint> transformfeedbacks_id_map_;
+ 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.
GLenum draw_buffer_;

Powered by Google App Engine
This is Rietveld 408576698