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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 uint32 max_varying_vectors() const { | 98 uint32 max_varying_vectors() const { |
99 return max_varying_vectors_; | 99 return max_varying_vectors_; |
100 } | 100 } |
101 | 101 |
102 uint32 max_vertex_uniform_vectors() const { | 102 uint32 max_vertex_uniform_vectors() const { |
103 return max_vertex_uniform_vectors_; | 103 return max_vertex_uniform_vectors_; |
104 } | 104 } |
105 | 105 |
| 106 uint32 max_color_attachments() const { |
| 107 return max_color_attachments_; |
| 108 } |
| 109 |
| 110 uint32 max_draw_buffers() const { |
| 111 return max_draw_buffers_; |
| 112 } |
| 113 |
106 FeatureInfo* feature_info() { | 114 FeatureInfo* feature_info() { |
107 return feature_info_.get(); | 115 return feature_info_.get(); |
108 } | 116 } |
109 | 117 |
110 BufferManager* buffer_manager() const { | 118 BufferManager* buffer_manager() const { |
111 return buffer_manager_.get(); | 119 return buffer_manager_.get(); |
112 } | 120 } |
113 | 121 |
114 FramebufferManager* framebuffer_manager() const { | 122 FramebufferManager* framebuffer_manager() const { |
115 return framebuffer_manager_.get(); | 123 return framebuffer_manager_.get(); |
(...skipping 27 matching lines...) Expand all Loading... |
143 return transfer_buffer_manager_.get(); | 151 return transfer_buffer_manager_.get(); |
144 } | 152 } |
145 | 153 |
146 IdAllocatorInterface* GetIdAllocator(unsigned namespace_id); | 154 IdAllocatorInterface* GetIdAllocator(unsigned namespace_id); |
147 | 155 |
148 uint32 GetMemRepresented() const; | 156 uint32 GetMemRepresented() const; |
149 | 157 |
150 // Loses all the context associated with this group. | 158 // Loses all the context associated with this group. |
151 void LoseContexts(GLenum reset_status); | 159 void LoseContexts(GLenum reset_status); |
152 | 160 |
| 161 // EXT_draw_buffer related states for backbuffer. |
| 162 GLenum draw_buffer() const { |
| 163 return draw_buffer_; |
| 164 } |
| 165 void set_draw_buffer(GLenum buf) { |
| 166 draw_buffer_ = buf; |
| 167 } |
| 168 |
153 private: | 169 private: |
154 friend class base::RefCounted<ContextGroup>; | 170 friend class base::RefCounted<ContextGroup>; |
155 ~ContextGroup(); | 171 ~ContextGroup(); |
156 | 172 |
157 bool CheckGLFeature(GLint min_required, GLint* v); | 173 bool CheckGLFeature(GLint min_required, GLint* v); |
158 bool CheckGLFeatureU(GLint min_required, uint32* v); | 174 bool CheckGLFeatureU(GLint min_required, uint32* v); |
159 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); | 175 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
160 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); | 176 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); |
161 bool HaveContexts(); | 177 bool HaveContexts(); |
162 | 178 |
163 scoped_refptr<MailboxManager> mailbox_manager_; | 179 scoped_refptr<MailboxManager> mailbox_manager_; |
164 scoped_refptr<ImageManager> image_manager_; | 180 scoped_refptr<ImageManager> image_manager_; |
165 scoped_refptr<MemoryTracker> memory_tracker_; | 181 scoped_refptr<MemoryTracker> memory_tracker_; |
166 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 182 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
167 | 183 |
168 bool enforce_gl_minimums_; | 184 bool enforce_gl_minimums_; |
169 bool bind_generates_resource_; | 185 bool bind_generates_resource_; |
170 | 186 |
171 uint32 max_vertex_attribs_; | 187 uint32 max_vertex_attribs_; |
172 uint32 max_texture_units_; | 188 uint32 max_texture_units_; |
173 uint32 max_texture_image_units_; | 189 uint32 max_texture_image_units_; |
174 uint32 max_vertex_texture_image_units_; | 190 uint32 max_vertex_texture_image_units_; |
175 uint32 max_fragment_uniform_vectors_; | 191 uint32 max_fragment_uniform_vectors_; |
176 uint32 max_varying_vectors_; | 192 uint32 max_varying_vectors_; |
177 uint32 max_vertex_uniform_vectors_; | 193 uint32 max_vertex_uniform_vectors_; |
| 194 uint32 max_color_attachments_; |
| 195 uint32 max_draw_buffers_; |
178 | 196 |
179 ProgramCache* program_cache_; | 197 ProgramCache* program_cache_; |
180 | 198 |
181 scoped_ptr<BufferManager> buffer_manager_; | 199 scoped_ptr<BufferManager> buffer_manager_; |
182 | 200 |
183 scoped_ptr<FramebufferManager> framebuffer_manager_; | 201 scoped_ptr<FramebufferManager> framebuffer_manager_; |
184 | 202 |
185 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 203 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
186 | 204 |
187 scoped_ptr<TextureManager> texture_manager_; | 205 scoped_ptr<TextureManager> texture_manager_; |
188 | 206 |
189 scoped_ptr<ProgramManager> program_manager_; | 207 scoped_ptr<ProgramManager> program_manager_; |
190 | 208 |
191 scoped_ptr<ShaderManager> shader_manager_; | 209 scoped_ptr<ShaderManager> shader_manager_; |
192 | 210 |
193 linked_ptr<IdAllocatorInterface> | 211 linked_ptr<IdAllocatorInterface> |
194 id_namespaces_[id_namespaces::kNumIdNamespaces]; | 212 id_namespaces_[id_namespaces::kNumIdNamespaces]; |
195 | 213 |
196 scoped_refptr<FeatureInfo> feature_info_; | 214 scoped_refptr<FeatureInfo> feature_info_; |
197 | 215 |
198 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; | 216 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; |
199 | 217 |
| 218 GLenum draw_buffer_; |
| 219 |
200 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 220 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
201 }; | 221 }; |
202 | 222 |
203 } // namespace gles2 | 223 } // namespace gles2 |
204 } // namespace gpu | 224 } // namespace gpu |
205 | 225 |
206 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 226 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
207 | 227 |
208 | 228 |
OLD | NEW |