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 GetDrawBuffer(GLenum draw_buffer) const; |
| 163 void SetDrawBuffers(GLsizei n, const GLenum* bufs); |
| 164 |
153 private: | 165 private: |
154 friend class base::RefCounted<ContextGroup>; | 166 friend class base::RefCounted<ContextGroup>; |
155 ~ContextGroup(); | 167 ~ContextGroup(); |
156 | 168 |
157 bool CheckGLFeature(GLint min_required, GLint* v); | 169 bool CheckGLFeature(GLint min_required, GLint* v); |
158 bool CheckGLFeatureU(GLint min_required, uint32* v); | 170 bool CheckGLFeatureU(GLint min_required, uint32* v); |
159 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); | 171 bool QueryGLFeature(GLenum pname, GLint min_required, GLint* v); |
160 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); | 172 bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v); |
161 bool HaveContexts(); | 173 bool HaveContexts(); |
162 | 174 |
163 scoped_refptr<MailboxManager> mailbox_manager_; | 175 scoped_refptr<MailboxManager> mailbox_manager_; |
164 scoped_refptr<ImageManager> image_manager_; | 176 scoped_refptr<ImageManager> image_manager_; |
165 scoped_refptr<MemoryTracker> memory_tracker_; | 177 scoped_refptr<MemoryTracker> memory_tracker_; |
166 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 178 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
167 | 179 |
168 bool enforce_gl_minimums_; | 180 bool enforce_gl_minimums_; |
169 bool bind_generates_resource_; | 181 bool bind_generates_resource_; |
170 | 182 |
171 uint32 max_vertex_attribs_; | 183 uint32 max_vertex_attribs_; |
172 uint32 max_texture_units_; | 184 uint32 max_texture_units_; |
173 uint32 max_texture_image_units_; | 185 uint32 max_texture_image_units_; |
174 uint32 max_vertex_texture_image_units_; | 186 uint32 max_vertex_texture_image_units_; |
175 uint32 max_fragment_uniform_vectors_; | 187 uint32 max_fragment_uniform_vectors_; |
176 uint32 max_varying_vectors_; | 188 uint32 max_varying_vectors_; |
177 uint32 max_vertex_uniform_vectors_; | 189 uint32 max_vertex_uniform_vectors_; |
| 190 uint32 max_color_attachments_; |
| 191 uint32 max_draw_buffers_; |
178 | 192 |
179 ProgramCache* program_cache_; | 193 ProgramCache* program_cache_; |
180 | 194 |
181 scoped_ptr<BufferManager> buffer_manager_; | 195 scoped_ptr<BufferManager> buffer_manager_; |
182 | 196 |
183 scoped_ptr<FramebufferManager> framebuffer_manager_; | 197 scoped_ptr<FramebufferManager> framebuffer_manager_; |
184 | 198 |
185 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 199 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
186 | 200 |
187 scoped_ptr<TextureManager> texture_manager_; | 201 scoped_ptr<TextureManager> texture_manager_; |
188 | 202 |
189 scoped_ptr<ProgramManager> program_manager_; | 203 scoped_ptr<ProgramManager> program_manager_; |
190 | 204 |
191 scoped_ptr<ShaderManager> shader_manager_; | 205 scoped_ptr<ShaderManager> shader_manager_; |
192 | 206 |
193 linked_ptr<IdAllocatorInterface> | 207 linked_ptr<IdAllocatorInterface> |
194 id_namespaces_[id_namespaces::kNumIdNamespaces]; | 208 id_namespaces_[id_namespaces::kNumIdNamespaces]; |
195 | 209 |
196 scoped_refptr<FeatureInfo> feature_info_; | 210 scoped_refptr<FeatureInfo> feature_info_; |
197 | 211 |
198 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; | 212 std::vector<base::WeakPtr<gles2::GLES2Decoder> > decoders_; |
199 | 213 |
| 214 scoped_array<GLenum> draw_buffers_; |
| 215 |
200 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 216 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
201 }; | 217 }; |
202 | 218 |
203 } // namespace gles2 | 219 } // namespace gles2 |
204 } // namespace gpu | 220 } // namespace gpu |
205 | 221 |
206 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 222 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
207 | 223 |
208 | 224 |
OLD | NEW |