summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/context_group.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 19:14:10 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 19:14:10 +0000
commit066849e369dae48bf61ae0cf70c9e9acaf9f1045 (patch)
tree479aebcba9d2f1d3b054dc3ea64baa9a7c753f15 /gpu/command_buffer/service/context_group.cc
parent0411509f65aae2b1ba684bf87343a14253246de0 (diff)
downloadchromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.zip
chromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.tar.gz
chromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.tar.bz2
Adds support for shared resources.
It's not clear how to test this easily it seems like we an integration test is needed at some point. I did run the conformance tests with share_resources set to true and it rand without crashing. TEST=unit tests BUG=none Review URL: http://codereview.chromium.org/1817002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/context_group.cc')
-rw-r--r--gpu/command_buffer/service/context_group.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc
index 6e85e30..7a62c72 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "gpu/command_buffer/service/context_group.h"
+#include "gpu/command_buffer/common/id_allocator.h"
#include "gpu/command_buffer/service/buffer_manager.h"
#include "gpu/command_buffer/service/framebuffer_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
@@ -55,6 +56,16 @@ bool ContextGroup::Initialize() {
return true;
}
+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;
+}
+
} // namespace gles2
} // namespace gpu