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

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

Issue 7554015: Implemented support for GL constext share groups in the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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.cc
===================================================================
--- gpu/command_buffer/service/context_group.cc (revision 95161)
+++ gpu/command_buffer/service/context_group.cc (working copy)
@@ -27,6 +27,12 @@
max_fragment_uniform_vectors_(0u),
max_varying_vectors_(0u),
max_vertex_uniform_vectors_(0u) {
+ id_namespaces_[id_namespaces::kBuffers].reset(new IdAllocator);
+ id_namespaces_[id_namespaces::kFramebuffers].reset(new IdAllocator);
+ id_namespaces_[id_namespaces::kProgramsAndShaders].reset(
+ new NonReusedIdAllocator);
+ id_namespaces_[id_namespaces::kRenderbuffers].reset(new IdAllocator);
+ id_namespaces_[id_namespaces::kTextures].reset(new IdAllocator);
}
ContextGroup::~ContextGroup() {
@@ -145,14 +151,11 @@
}
}
-IdAllocator* ContextGroup::GetIdAllocator(unsigned namespace_id) {
- IdAllocatorMap::iterator it = id_namespaces_.find(namespace_id);
- if (it != id_namespaces_.end()) {
- return it->second.get();
- }
- IdAllocator* id_allocator = new IdAllocator();
- id_namespaces_[namespace_id] = linked_ptr<IdAllocator>(id_allocator);
- return id_allocator;
+IdAllocatorInterface* ContextGroup::GetIdAllocator(unsigned namespace_id) {
+ if (namespace_id >= arraysize(id_namespaces_))
+ return NULL;
+
+ return id_namespaces_[namespace_id].get();
}
} // namespace gles2

Powered by Google App Engine
This is Rietveld 408576698