summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/context_group.h
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 03:20:50 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 03:20:50 +0000
commit3916c97e1bb1ef3fecfdcaf9d80f239016756c06 (patch)
tree5c756aa2feec17d4a5609bcf2a16a06a12b828e8 /gpu/command_buffer/service/context_group.h
parent84aebedeaa91c3fadf523260c12afa136420c7d3 (diff)
downloadchromium_src-3916c97e1bb1ef3fecfdcaf9d80f239016756c06.zip
chromium_src-3916c97e1bb1ef3fecfdcaf9d80f239016756c06.tar.gz
chromium_src-3916c97e1bb1ef3fecfdcaf9d80f239016756c06.tar.bz2
Reorangizing the GLES2 code to handle shared
resources and non-renderable texture situations. I haven't written enough unit tests for this but the CL is already too big. TEST=none BUG=none Review URL: http://codereview.chromium.org/646070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/context_group.h')
-rw-r--r--gpu/command_buffer/service/context_group.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h
new file mode 100644
index 0000000..362be16
--- /dev/null
+++ b/gpu/command_buffer/service/context_group.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
+#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
+
+#include <vector>
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+
+namespace gpu {
+namespace gles2 {
+
+class GLES2Decoder;
+class BufferManager;
+class IdManager;
+class ProgramManager;
+class ShaderManager;
+class TextureManager;
+
+// A Context Group helps manage multiple GLES2Decoders that share
+// resources.
+class ContextGroup {
+ public:
+ ContextGroup();
+ ~ContextGroup();
+
+ // This should only be called by GLES2Decoder.
+ bool Initialize();
+
+ uint32 max_vertex_attribs() const {
+ return max_vertex_attribs_;
+ }
+
+ uint32 max_texture_units() const {
+ return max_texture_units_;
+ }
+
+ // Map of client ids to GL ids.
+ IdManager* id_manager() const {
+ return id_manager_.get();
+ }
+
+ BufferManager* buffer_manager() const {
+ return buffer_manager_.get();
+ }
+
+ TextureManager* texture_manager() const {
+ return texture_manager_.get();
+ }
+
+ ProgramManager* program_manager() const {
+ return program_manager_.get();
+ }
+
+ ShaderManager* shader_manager() const {
+ return shader_manager_.get();
+ }
+
+ private:
+ // Whether or not this context is initialized.
+ bool initialized_;
+
+ uint32 max_vertex_attribs_;
+
+ uint32 max_texture_units_;
+
+ // Map of client ids to GL ids.
+ scoped_ptr<IdManager> id_manager_;
+
+ scoped_ptr<BufferManager> buffer_manager_;
+
+ scoped_ptr<TextureManager> texture_manager_;
+
+ scoped_ptr<ProgramManager> program_manager_;
+
+ scoped_ptr<ShaderManager> shader_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContextGroup);
+};
+
+} // namespace gles2
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
+
+