OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 class ValuebufferManager; | 37 class ValuebufferManager; |
38 class MemoryTracker; | 38 class MemoryTracker; |
39 struct DisallowedFeatures; | 39 struct DisallowedFeatures; |
40 | 40 |
41 // A Context Group helps manage multiple GLES2Decoders that share | 41 // A Context Group helps manage multiple GLES2Decoders that share |
42 // resources. | 42 // resources. |
43 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { | 43 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
44 public: | 44 public: |
45 ContextGroup( | 45 ContextGroup( |
46 const scoped_refptr<MailboxManager>& mailbox_manager, | 46 const scoped_refptr<MailboxManager>& mailbox_manager, |
| 47 const scoped_refptr<ValuebufferManager>& valuebuffer_manager, |
47 const scoped_refptr<MemoryTracker>& memory_tracker, | 48 const scoped_refptr<MemoryTracker>& memory_tracker, |
48 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, | 49 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
49 const scoped_refptr<FeatureInfo>& feature_info, | 50 const scoped_refptr<FeatureInfo>& feature_info, |
50 bool bind_generates_resource); | 51 bool bind_generates_resource); |
51 | 52 |
52 // This should only be called by GLES2Decoder. This must be paired with a | 53 // This should only be called by GLES2Decoder. This must be paired with a |
53 // call to destroy if it succeeds. | 54 // call to destroy if it succeeds. |
54 bool Initialize( | 55 bool Initialize( |
55 GLES2Decoder* decoder, | 56 GLES2Decoder* decoder, |
56 const DisallowedFeatures& disallowed_features); | 57 const DisallowedFeatures& disallowed_features); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 friend class base::RefCounted<ContextGroup>; | 173 friend class base::RefCounted<ContextGroup>; |
173 ~ContextGroup(); | 174 ~ContextGroup(); |
174 | 175 |
175 bool CheckGLFeature(GLint min_required, GLint* v); | 176 bool CheckGLFeature(GLint min_required, GLint* v); |
176 bool CheckGLFeatureU(GLint min_required, uint32* v); | 177 bool CheckGLFeatureU(GLint min_required, uint32* v); |
177 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); | 178 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
178 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); | 179 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); |
179 bool HaveContexts(); | 180 bool HaveContexts(); |
180 | 181 |
181 scoped_refptr<MailboxManager> mailbox_manager_; | 182 scoped_refptr<MailboxManager> mailbox_manager_; |
| 183 scoped_refptr<ValuebufferManager> valuebuffer_manager_; |
182 scoped_refptr<MemoryTracker> memory_tracker_; | 184 scoped_refptr<MemoryTracker> memory_tracker_; |
183 scoped_refptr<ShaderTranslatorCache> shader_translator_cache_; | 185 scoped_refptr<ShaderTranslatorCache> shader_translator_cache_; |
184 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 186 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
185 | 187 |
186 bool enforce_gl_minimums_; | 188 bool enforce_gl_minimums_; |
187 bool bind_generates_resource_; | 189 bool bind_generates_resource_; |
188 | 190 |
189 uint32 max_vertex_attribs_; | 191 uint32 max_vertex_attribs_; |
190 uint32 max_texture_units_; | 192 uint32 max_texture_units_; |
191 uint32 max_texture_image_units_; | 193 uint32 max_texture_image_units_; |
192 uint32 max_vertex_texture_image_units_; | 194 uint32 max_vertex_texture_image_units_; |
193 uint32 max_fragment_uniform_vectors_; | 195 uint32 max_fragment_uniform_vectors_; |
194 uint32 max_varying_vectors_; | 196 uint32 max_varying_vectors_; |
195 uint32 max_vertex_uniform_vectors_; | 197 uint32 max_vertex_uniform_vectors_; |
196 uint32 max_color_attachments_; | 198 uint32 max_color_attachments_; |
197 uint32 max_draw_buffers_; | 199 uint32 max_draw_buffers_; |
198 | 200 |
199 ProgramCache* program_cache_; | 201 ProgramCache* program_cache_; |
200 | 202 |
201 scoped_ptr<BufferManager> buffer_manager_; | 203 scoped_ptr<BufferManager> buffer_manager_; |
202 | 204 |
203 scoped_ptr<FramebufferManager> framebuffer_manager_; | 205 scoped_ptr<FramebufferManager> framebuffer_manager_; |
204 | 206 |
205 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 207 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
206 | 208 |
207 scoped_ptr<ValuebufferManager> valuebuffer_manager_; | |
208 | |
209 scoped_ptr<TextureManager> texture_manager_; | 209 scoped_ptr<TextureManager> texture_manager_; |
210 | 210 |
211 scoped_ptr<ProgramManager> program_manager_; | 211 scoped_ptr<ProgramManager> program_manager_; |
212 | 212 |
213 scoped_ptr<ShaderManager> shader_manager_; | 213 scoped_ptr<ShaderManager> shader_manager_; |
214 | 214 |
215 scoped_refptr<FeatureInfo> feature_info_; | 215 scoped_refptr<FeatureInfo> feature_info_; |
216 | 216 |
217 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; | 217 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; |
218 | 218 |
219 GLenum draw_buffer_; | 219 GLenum draw_buffer_; |
220 | 220 |
221 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 221 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
222 }; | 222 }; |
223 | 223 |
224 } // namespace gles2 | 224 } // namespace gles2 |
225 } // namespace gpu | 225 } // namespace gpu |
226 | 226 |
227 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 227 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
228 | 228 |
229 | 229 |
OLD | NEW |