Chromium Code Reviews| 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 "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 "base/memory/weak_ptr.h" | |
|
greggman
2012/06/25 18:53:03
Is this needed?
dmurph
2012/06/26 02:32:56
Nope, thought I had caught all of these haha.
| |
| 14 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 15 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 15 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 16 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
| 16 #include "gpu/command_buffer/service/feature_info.h" | 17 #include "gpu/command_buffer/service/feature_info.h" |
| 17 #include "gpu/gpu_export.h" | 18 #include "gpu/gpu_export.h" |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| 21 class IdAllocatorInterface; | 22 class IdAllocatorInterface; |
| 22 class TransferBufferManagerInterface; | 23 class TransferBufferManagerInterface; |
| 23 | 24 |
| 24 namespace gles2 { | 25 namespace gles2 { |
| 25 | 26 |
| 27 class ProgramCache; | |
| 26 class BufferManager; | 28 class BufferManager; |
| 27 class GLES2Decoder; | 29 class GLES2Decoder; |
| 28 class FramebufferManager; | 30 class FramebufferManager; |
| 29 class MailboxManager; | 31 class MailboxManager; |
| 30 class RenderbufferManager; | 32 class RenderbufferManager; |
| 31 class ProgramManager; | 33 class ProgramManager; |
| 32 class ShaderManager; | 34 class ShaderManager; |
| 33 class TextureManager; | 35 class TextureManager; |
| 34 struct DisallowedFeatures; | 36 struct DisallowedFeatures; |
| 35 | 37 |
| 36 // A Context Group helps manage multiple GLES2Decoders that share | 38 // A Context Group helps manage multiple GLES2Decoders that share |
| 37 // resources. | 39 // resources. |
| 38 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { | 40 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
| 39 public: | 41 public: |
| 40 typedef scoped_refptr<ContextGroup> Ref; | 42 typedef scoped_refptr<ContextGroup> Ref; |
| 41 | 43 |
| 42 ContextGroup( | 44 ContextGroup( |
| 43 MailboxManager* mailbox_manager, | 45 MailboxManager* mailbox_manager, |
| 44 bool bind_generates_resource); | 46 bool bind_generates_resource, |
| 47 ProgramCache* program_cache); | |
| 45 | 48 |
| 46 // This should only be called by GLES2Decoder. This must be paired with a | 49 // This should only be called by GLES2Decoder. This must be paired with a |
| 47 // call to destroy if it succeeds. | 50 // call to destroy if it succeeds. |
| 48 bool Initialize(const DisallowedFeatures& disallowed_features, | 51 bool Initialize(const DisallowedFeatures& disallowed_features, |
| 49 const char* allowed_features); | 52 const char* allowed_features); |
| 50 | 53 |
| 51 // Destroys all the resources when called for the last context in the group. | 54 // Destroys all the resources when called for the last context in the group. |
| 52 // It should only be called by GLES2Decoder. | 55 // It should only be called by GLES2Decoder. |
| 53 void Destroy(bool have_context); | 56 void Destroy(bool have_context); |
| 54 | 57 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 bool bind_generates_resource_; | 145 bool bind_generates_resource_; |
| 143 | 146 |
| 144 uint32 max_vertex_attribs_; | 147 uint32 max_vertex_attribs_; |
| 145 uint32 max_texture_units_; | 148 uint32 max_texture_units_; |
| 146 uint32 max_texture_image_units_; | 149 uint32 max_texture_image_units_; |
| 147 uint32 max_vertex_texture_image_units_; | 150 uint32 max_vertex_texture_image_units_; |
| 148 uint32 max_fragment_uniform_vectors_; | 151 uint32 max_fragment_uniform_vectors_; |
| 149 uint32 max_varying_vectors_; | 152 uint32 max_varying_vectors_; |
| 150 uint32 max_vertex_uniform_vectors_; | 153 uint32 max_vertex_uniform_vectors_; |
| 151 | 154 |
| 155 ProgramCache* program_cache_; | |
| 156 | |
| 152 scoped_ptr<BufferManager> buffer_manager_; | 157 scoped_ptr<BufferManager> buffer_manager_; |
| 153 | 158 |
| 154 scoped_ptr<FramebufferManager> framebuffer_manager_; | 159 scoped_ptr<FramebufferManager> framebuffer_manager_; |
| 155 | 160 |
| 156 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 161 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
| 157 | 162 |
| 158 scoped_ptr<TextureManager> texture_manager_; | 163 scoped_ptr<TextureManager> texture_manager_; |
| 159 | 164 |
| 160 scoped_ptr<ProgramManager> program_manager_; | 165 scoped_ptr<ProgramManager> program_manager_; |
| 161 | 166 |
| 162 scoped_ptr<ShaderManager> shader_manager_; | 167 scoped_ptr<ShaderManager> shader_manager_; |
| 163 | 168 |
| 164 linked_ptr<IdAllocatorInterface> | 169 linked_ptr<IdAllocatorInterface> |
| 165 id_namespaces_[id_namespaces::kNumIdNamespaces]; | 170 id_namespaces_[id_namespaces::kNumIdNamespaces]; |
| 166 | 171 |
| 167 FeatureInfo::Ref feature_info_; | 172 FeatureInfo::Ref feature_info_; |
| 168 | 173 |
| 169 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 174 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 } // namespace gles2 | 177 } // namespace gles2 |
| 173 } // namespace gpu | 178 } // namespace gpu |
| 174 | 179 |
| 175 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 180 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
| 176 | 181 |
| 177 | 182 |
| OLD | NEW |