OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
14 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 15 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
15 #include "gpu/command_buffer/service/feature_info.h" | 16 #include "gpu/command_buffer/service/feature_info.h" |
16 | 17 |
17 namespace gpu { | 18 namespace gpu { |
18 | 19 |
19 class IdAllocator; | 20 class IdAllocatorInterface; |
20 | 21 |
21 namespace gles2 { | 22 namespace gles2 { |
22 | 23 |
23 class GLES2Decoder; | 24 class GLES2Decoder; |
24 class BufferManager; | 25 class BufferManager; |
25 class FramebufferManager; | 26 class FramebufferManager; |
26 class RenderbufferManager; | 27 class RenderbufferManager; |
27 class ProgramManager; | 28 class ProgramManager; |
28 class ShaderManager; | 29 class ShaderManager; |
29 class TextureManager; | 30 class TextureManager; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 97 } |
97 | 98 |
98 ProgramManager* program_manager() const { | 99 ProgramManager* program_manager() const { |
99 return program_manager_.get(); | 100 return program_manager_.get(); |
100 } | 101 } |
101 | 102 |
102 ShaderManager* shader_manager() const { | 103 ShaderManager* shader_manager() const { |
103 return shader_manager_.get(); | 104 return shader_manager_.get(); |
104 } | 105 } |
105 | 106 |
106 IdAllocator* GetIdAllocator(unsigned namepsace_id); | 107 IdAllocatorInterface* GetIdAllocator(unsigned namespace_id); |
107 | 108 |
108 private: | 109 private: |
109 // Destroys all the resources. | 110 // Destroys all the resources. |
110 void Destroy(); | 111 void Destroy(); |
111 | 112 |
112 // Whether or not this context is initialized. | 113 // Whether or not this context is initialized. |
113 bool initialized_; | 114 bool initialized_; |
114 bool have_context_; | 115 bool have_context_; |
115 | 116 |
116 uint32 max_vertex_attribs_; | 117 uint32 max_vertex_attribs_; |
117 uint32 max_texture_units_; | 118 uint32 max_texture_units_; |
118 uint32 max_texture_image_units_; | 119 uint32 max_texture_image_units_; |
119 uint32 max_vertex_texture_image_units_; | 120 uint32 max_vertex_texture_image_units_; |
120 uint32 max_fragment_uniform_vectors_; | 121 uint32 max_fragment_uniform_vectors_; |
121 uint32 max_varying_vectors_; | 122 uint32 max_varying_vectors_; |
122 uint32 max_vertex_uniform_vectors_; | 123 uint32 max_vertex_uniform_vectors_; |
123 | 124 |
124 scoped_ptr<BufferManager> buffer_manager_; | 125 scoped_ptr<BufferManager> buffer_manager_; |
125 | 126 |
126 scoped_ptr<FramebufferManager> framebuffer_manager_; | 127 scoped_ptr<FramebufferManager> framebuffer_manager_; |
127 | 128 |
128 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 129 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
129 | 130 |
130 scoped_ptr<TextureManager> texture_manager_; | 131 scoped_ptr<TextureManager> texture_manager_; |
131 | 132 |
132 scoped_ptr<ProgramManager> program_manager_; | 133 scoped_ptr<ProgramManager> program_manager_; |
133 | 134 |
134 scoped_ptr<ShaderManager> shader_manager_; | 135 scoped_ptr<ShaderManager> shader_manager_; |
135 | 136 |
136 typedef base::hash_map<uint32, linked_ptr<IdAllocator> > IdAllocatorMap; | 137 linked_ptr<IdAllocatorInterface> |
137 IdAllocatorMap id_namespaces_; | 138 id_namespaces_[id_namespaces::kNumIdNamespaces]; |
138 | 139 |
139 FeatureInfo feature_info_; | 140 FeatureInfo feature_info_; |
140 | 141 |
141 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 142 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
142 }; | 143 }; |
143 | 144 |
144 } // namespace gles2 | 145 } // namespace gles2 |
145 } // namespace gpu | 146 } // namespace gpu |
146 | 147 |
147 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 148 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
148 | 149 |
149 | 150 |
OLD | NEW |