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 <vector> | 8 #include <vector> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "gpu/command_buffer/common/constants.h" | 14 #include "gpu/command_buffer/common/constants.h" |
15 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 15 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
16 #include "gpu/command_buffer/service/feature_info.h" | 16 #include "gpu/command_buffer/service/feature_info.h" |
| 17 #include "gpu/command_buffer/service/framebuffer_completeness_cache.h" |
17 #include "gpu/command_buffer/service/shader_translator_cache.h" | 18 #include "gpu/command_buffer/service/shader_translator_cache.h" |
18 #include "gpu/gpu_export.h" | 19 #include "gpu/gpu_export.h" |
19 | 20 |
20 namespace gpu { | 21 namespace gpu { |
21 | 22 |
22 class TransferBufferManagerInterface; | 23 class TransferBufferManagerInterface; |
23 class ValueStateMap; | 24 class ValueStateMap; |
24 | 25 |
25 namespace gles2 { | 26 namespace gles2 { |
26 | 27 |
(...skipping 22 matching lines...) Expand all Loading... |
49 CONTEXT_TYPE_OTHER, | 50 CONTEXT_TYPE_OTHER, |
50 CONTEXT_TYPE_UNDEFINED | 51 CONTEXT_TYPE_UNDEFINED |
51 }; | 52 }; |
52 | 53 |
53 static ContextType GetContextType(unsigned webgl_version); | 54 static ContextType GetContextType(unsigned webgl_version); |
54 | 55 |
55 ContextGroup( | 56 ContextGroup( |
56 const scoped_refptr<MailboxManager>& mailbox_manager, | 57 const scoped_refptr<MailboxManager>& mailbox_manager, |
57 const scoped_refptr<MemoryTracker>& memory_tracker, | 58 const scoped_refptr<MemoryTracker>& memory_tracker, |
58 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, | 59 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, |
| 60 const scoped_refptr<FramebufferCompletenessCache>& |
| 61 framebuffer_completeness_cache, |
59 const scoped_refptr<FeatureInfo>& feature_info, | 62 const scoped_refptr<FeatureInfo>& feature_info, |
60 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set, | 63 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set, |
61 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state, | 64 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state, |
62 bool bind_generates_resource); | 65 bool bind_generates_resource); |
63 | 66 |
64 // This should only be called by GLES2Decoder. This must be paired with a | 67 // This should only be called by GLES2Decoder. This must be paired with a |
65 // call to destroy if it succeeds. | 68 // call to destroy if it succeeds. |
66 bool Initialize( | 69 bool Initialize( |
67 GLES2Decoder* decoder, | 70 GLES2Decoder* decoder, |
68 ContextType context_type, | 71 ContextType context_type, |
69 const DisallowedFeatures& disallowed_features); | 72 const DisallowedFeatures& disallowed_features); |
70 | 73 |
71 // Destroys all the resources when called for the last context in the group. | 74 // Destroys all the resources when called for the last context in the group. |
72 // It should only be called by GLES2Decoder. | 75 // It should only be called by GLES2Decoder. |
73 void Destroy(GLES2Decoder* decoder, bool have_context); | 76 void Destroy(GLES2Decoder* decoder, bool have_context); |
74 | 77 |
75 MailboxManager* mailbox_manager() const { | 78 MailboxManager* mailbox_manager() const { |
76 return mailbox_manager_.get(); | 79 return mailbox_manager_.get(); |
77 } | 80 } |
78 | 81 |
79 MemoryTracker* memory_tracker() const { | 82 MemoryTracker* memory_tracker() const { |
80 return memory_tracker_.get(); | 83 return memory_tracker_.get(); |
81 } | 84 } |
82 | 85 |
83 ShaderTranslatorCache* shader_translator_cache() const { | 86 ShaderTranslatorCache* shader_translator_cache() const { |
84 return shader_translator_cache_.get(); | 87 return shader_translator_cache_.get(); |
85 } | 88 } |
86 | 89 |
| 90 FramebufferCompletenessCache* framebuffer_completeness_cache() const { |
| 91 return framebuffer_completeness_cache_.get(); |
| 92 } |
| 93 |
87 bool bind_generates_resource() { | 94 bool bind_generates_resource() { |
88 return bind_generates_resource_; | 95 return bind_generates_resource_; |
89 } | 96 } |
90 | 97 |
91 uint32 max_vertex_attribs() const { | 98 uint32 max_vertex_attribs() const { |
92 return max_vertex_attribs_; | 99 return max_vertex_attribs_; |
93 } | 100 } |
94 | 101 |
95 uint32 max_texture_units() const { | 102 uint32 max_texture_units() const { |
96 return max_texture_units_; | 103 return max_texture_units_; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 bool CheckGLFeatureU(GLint min_required, uint32* v); | 257 bool CheckGLFeatureU(GLint min_required, uint32* v); |
251 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); | 258 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
252 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); | 259 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); |
253 bool HaveContexts(); | 260 bool HaveContexts(); |
254 | 261 |
255 ContextType context_type_; | 262 ContextType context_type_; |
256 | 263 |
257 scoped_refptr<MailboxManager> mailbox_manager_; | 264 scoped_refptr<MailboxManager> mailbox_manager_; |
258 scoped_refptr<MemoryTracker> memory_tracker_; | 265 scoped_refptr<MemoryTracker> memory_tracker_; |
259 scoped_refptr<ShaderTranslatorCache> shader_translator_cache_; | 266 scoped_refptr<ShaderTranslatorCache> shader_translator_cache_; |
| 267 scoped_refptr<FramebufferCompletenessCache> framebuffer_completeness_cache_; |
260 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 268 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
261 scoped_refptr<SubscriptionRefSet> subscription_ref_set_; | 269 scoped_refptr<SubscriptionRefSet> subscription_ref_set_; |
262 scoped_refptr<ValueStateMap> pending_valuebuffer_state_; | 270 scoped_refptr<ValueStateMap> pending_valuebuffer_state_; |
263 | 271 |
264 bool enforce_gl_minimums_; | 272 bool enforce_gl_minimums_; |
265 bool bind_generates_resource_; | 273 bool bind_generates_resource_; |
266 | 274 |
267 uint32 max_vertex_attribs_; | 275 uint32 max_vertex_attribs_; |
268 uint32 max_texture_units_; | 276 uint32 max_texture_units_; |
269 uint32 max_texture_image_units_; | 277 uint32 max_texture_image_units_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 311 |
304 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 312 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
305 }; | 313 }; |
306 | 314 |
307 } // namespace gles2 | 315 } // namespace gles2 |
308 } // namespace gpu | 316 } // namespace gpu |
309 | 317 |
310 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 318 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
311 | 319 |
312 | 320 |
OLD | NEW |