Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: gpu/command_buffer/service/context_group.h

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Patch Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/command_buffer/common/gles2_cmd_format.h" 14 #include "gpu/command_buffer/common/gles2_cmd_format.h"
15 #include "gpu/command_buffer/service/gles2_cmd_validation.h" 15 #include "gpu/command_buffer/service/gles2_cmd_validation.h"
16 #include "gpu/command_buffer/service/feature_info.h" 16 #include "gpu/command_buffer/service/feature_info.h"
17 #include "gpu/gpu_export.h" 17 #include "gpu/gpu_export.h"
18 18
19 namespace gpu { 19 namespace gpu {
20 20
21 class IdAllocatorInterface; 21 class IdAllocatorInterface;
22 class TransferBufferManagerInterface; 22 class TransferBufferManagerInterface;
23 23
24 namespace gles2 { 24 namespace gles2 {
25 25
26 class ProgramCache;
26 class BufferManager; 27 class BufferManager;
27 class GLES2Decoder; 28 class GLES2Decoder;
28 class FramebufferManager; 29 class FramebufferManager;
29 class MailboxManager; 30 class MailboxManager;
30 class RenderbufferManager; 31 class RenderbufferManager;
31 class ProgramManager; 32 class ProgramManager;
32 class ShaderManager; 33 class ShaderManager;
33 class TextureManager; 34 class TextureManager;
34 struct DisallowedFeatures; 35 struct DisallowedFeatures;
35 36
36 // A Context Group helps manage multiple GLES2Decoders that share 37 // A Context Group helps manage multiple GLES2Decoders that share
37 // resources. 38 // resources.
38 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { 39 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
39 public: 40 public:
40 typedef scoped_refptr<ContextGroup> Ref; 41 typedef scoped_refptr<ContextGroup> Ref;
41 42
42 ContextGroup( 43 ContextGroup(
43 MailboxManager* mailbox_manager, 44 MailboxManager* mailbox_manager,
44 bool bind_generates_resource); 45 bool bind_generates_resource,
46 ProgramCache* program_cache);
45 47
46 // This should only be called by GLES2Decoder. This must be paired with a 48 // This should only be called by GLES2Decoder. This must be paired with a
47 // call to destroy if it succeeds. 49 // call to destroy if it succeeds.
48 bool Initialize(const DisallowedFeatures& disallowed_features, 50 bool Initialize(const DisallowedFeatures& disallowed_features,
49 const char* allowed_features); 51 const char* allowed_features);
50 52
51 // Destroys all the resources when called for the last context in the group. 53 // Destroys all the resources when called for the last context in the group.
52 // It should only be called by GLES2Decoder. 54 // It should only be called by GLES2Decoder.
53 void Destroy(bool have_context); 55 void Destroy(bool have_context);
54 56
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 bool bind_generates_resource_; 144 bool bind_generates_resource_;
143 145
144 uint32 max_vertex_attribs_; 146 uint32 max_vertex_attribs_;
145 uint32 max_texture_units_; 147 uint32 max_texture_units_;
146 uint32 max_texture_image_units_; 148 uint32 max_texture_image_units_;
147 uint32 max_vertex_texture_image_units_; 149 uint32 max_vertex_texture_image_units_;
148 uint32 max_fragment_uniform_vectors_; 150 uint32 max_fragment_uniform_vectors_;
149 uint32 max_varying_vectors_; 151 uint32 max_varying_vectors_;
150 uint32 max_vertex_uniform_vectors_; 152 uint32 max_vertex_uniform_vectors_;
151 153
154 ProgramCache* program_cache_;
155
152 scoped_ptr<BufferManager> buffer_manager_; 156 scoped_ptr<BufferManager> buffer_manager_;
153 157
154 scoped_ptr<FramebufferManager> framebuffer_manager_; 158 scoped_ptr<FramebufferManager> framebuffer_manager_;
155 159
156 scoped_ptr<RenderbufferManager> renderbuffer_manager_; 160 scoped_ptr<RenderbufferManager> renderbuffer_manager_;
157 161
158 scoped_ptr<TextureManager> texture_manager_; 162 scoped_ptr<TextureManager> texture_manager_;
159 163
160 scoped_ptr<ProgramManager> program_manager_; 164 scoped_ptr<ProgramManager> program_manager_;
161 165
162 scoped_ptr<ShaderManager> shader_manager_; 166 scoped_ptr<ShaderManager> shader_manager_;
163 167
164 linked_ptr<IdAllocatorInterface> 168 linked_ptr<IdAllocatorInterface>
165 id_namespaces_[id_namespaces::kNumIdNamespaces]; 169 id_namespaces_[id_namespaces::kNumIdNamespaces];
166 170
167 FeatureInfo::Ref feature_info_; 171 FeatureInfo::Ref feature_info_;
168 172
169 DISALLOW_COPY_AND_ASSIGN(ContextGroup); 173 DISALLOW_COPY_AND_ASSIGN(ContextGroup);
170 }; 174 };
171 175
172 } // namespace gles2 176 } // namespace gles2
173 } // namespace gpu 177 } // namespace gpu
174 178
175 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ 179 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_
176 180
177 181
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698