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

Unified Diff: gpu/command_buffer/service/context_group.h

Issue 863253002: Update from https://crrev.com/312600 (Closed) Base URL: https://github.com/domokit/mojo.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 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..248fa193b07ea375591977b66ad647a23b411f92 100644
--- a/gpu/command_buffer/service/context_group.h
+++ b/gpu/command_buffer/service/context_group.h
@@ -5,7 +5,6 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
-#include <map>
#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -184,7 +183,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
}
bool GetSamplerServiceId(GLuint client_id, GLuint* service_id) const {
- std::map<GLuint, GLuint>::const_iterator iter =
+ base::hash_map<GLuint, GLuint>::const_iterator iter =
samplers_id_map_.find(client_id);
if (iter == samplers_id_map_.end())
return false;
@@ -203,7 +202,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
bool GetTransformFeedbackServiceId(
GLuint client_id, GLuint* service_id) const {
- std::map<GLuint, GLuint>::const_iterator iter =
+ base::hash_map<GLuint, GLuint>::const_iterator iter =
transformfeedbacks_id_map_.find(client_id);
if (iter == transformfeedbacks_id_map_.end())
return false;
@@ -216,6 +215,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 {
+ base::hash_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();
@@ -267,8 +284,9 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_;
// Mappings from client side IDs to service side IDs.
- std::map<GLuint, GLuint> samplers_id_map_;
- std::map<GLuint, GLuint> transformfeedbacks_id_map_;
+ base::hash_map<GLuint, GLuint> samplers_id_map_;
+ base::hash_map<GLuint, GLuint> transformfeedbacks_id_map_;
+ base::hash_map<GLuint, GLsync> syncs_id_map_;
GLenum draw_buffer_;

Powered by Google App Engine
This is Rietveld 408576698