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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 26 matching lines...) Expand all Loading... |
37 class FramebufferManager; | 37 class FramebufferManager; |
38 class MailboxManager; | 38 class MailboxManager; |
39 class RenderbufferManager; | 39 class RenderbufferManager; |
40 class PathManager; | 40 class PathManager; |
41 class ProgramManager; | 41 class ProgramManager; |
42 class SamplerManager; | 42 class SamplerManager; |
43 class ShaderManager; | 43 class ShaderManager; |
44 class TextureManager; | 44 class TextureManager; |
45 class MemoryTracker; | 45 class MemoryTracker; |
46 struct DisallowedFeatures; | 46 struct DisallowedFeatures; |
| 47 struct PassthroughResources; |
47 | 48 |
48 // A Context Group helps manage multiple GLES2Decoders that share | 49 // A Context Group helps manage multiple GLES2Decoders that share |
49 // resources. | 50 // resources. |
50 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { | 51 class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> { |
51 public: | 52 public: |
52 ContextGroup( | 53 ContextGroup( |
53 const GpuPreferences& gpu_preferences, | 54 const GpuPreferences& gpu_preferences, |
54 const scoped_refptr<MailboxManager>& mailbox_manager, | 55 const scoped_refptr<MailboxManager>& mailbox_manager, |
55 const scoped_refptr<MemoryTracker>& memory_tracker, | 56 const scoped_refptr<MemoryTracker>& memory_tracker, |
56 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, | 57 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return false; | 214 return false; |
214 if (service_id) | 215 if (service_id) |
215 *service_id = iter->second; | 216 *service_id = iter->second; |
216 return true; | 217 return true; |
217 } | 218 } |
218 | 219 |
219 void RemoveSyncId(GLuint client_id) { | 220 void RemoveSyncId(GLuint client_id) { |
220 syncs_id_map_.erase(client_id); | 221 syncs_id_map_.erase(client_id); |
221 } | 222 } |
222 | 223 |
| 224 PassthroughResources* passthrough_resources() const { |
| 225 return passthrough_resources_.get(); |
| 226 } |
| 227 |
223 private: | 228 private: |
224 friend class base::RefCounted<ContextGroup>; | 229 friend class base::RefCounted<ContextGroup>; |
225 ~ContextGroup(); | 230 ~ContextGroup(); |
226 | 231 |
227 bool CheckGLFeature(GLint min_required, GLint* v); | 232 bool CheckGLFeature(GLint min_required, GLint* v); |
228 bool CheckGLFeatureU(GLint min_required, uint32_t* v); | 233 bool CheckGLFeatureU(GLint min_required, uint32_t* v); |
229 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); | 234 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
230 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32_t* v); | 235 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32_t* v); |
231 bool HaveContexts(); | 236 bool HaveContexts(); |
232 | 237 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 285 |
281 scoped_refptr<FeatureInfo> feature_info_; | 286 scoped_refptr<FeatureInfo> feature_info_; |
282 | 287 |
283 gpu::ImageFactory* image_factory_; | 288 gpu::ImageFactory* image_factory_; |
284 | 289 |
285 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; | 290 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; |
286 | 291 |
287 // Mappings from client side IDs to service side IDs. | 292 // Mappings from client side IDs to service side IDs. |
288 base::hash_map<GLuint, GLsync> syncs_id_map_; | 293 base::hash_map<GLuint, GLsync> syncs_id_map_; |
289 | 294 |
| 295 std::unique_ptr<PassthroughResources> passthrough_resources_; |
| 296 |
290 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 297 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
291 }; | 298 }; |
292 | 299 |
293 } // namespace gles2 | 300 } // namespace gles2 |
294 } // namespace gpu | 301 } // namespace gpu |
295 | 302 |
296 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 303 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
OLD | NEW |