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_FRAMEBUFFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 std::unique_ptr<GLenum[]> draw_buffers_; | 228 std::unique_ptr<GLenum[]> draw_buffers_; |
229 | 229 |
230 GLenum read_buffer_; | 230 GLenum read_buffer_; |
231 | 231 |
232 DISALLOW_COPY_AND_ASSIGN(Framebuffer); | 232 DISALLOW_COPY_AND_ASSIGN(Framebuffer); |
233 }; | 233 }; |
234 | 234 |
235 struct DecoderFramebufferState { | 235 struct DecoderFramebufferState { |
236 DecoderFramebufferState(); | 236 DecoderFramebufferState(); |
237 ~DecoderFramebufferState(); | 237 ~DecoderFramebufferState(); |
| 238 bool is_draw_binding_dirty() const { return draw_binding_dirty_; } |
| 239 bool is_read_binding_dirty() const { return read_binding_dirty_; } |
| 240 |
| 241 void set_draw_framebuffer_clear_state_dirty(bool flag) { |
| 242 draw_framebuffer_clear_state_dirty_ = flag; |
| 243 } |
| 244 bool is_draw_framebuffer_clear_state_dirty() const { |
| 245 return draw_framebuffer_clear_state_dirty_; |
| 246 } |
| 247 |
| 248 void set_bound_draw_framebuffer(Framebuffer* framebuffer); |
| 249 void set_bound_read_framebuffer(Framebuffer* framebuffer); |
| 250 Framebuffer* bound_draw_framebuffer() const { |
| 251 return bound_draw_framebuffer_.get(); |
| 252 } |
| 253 Framebuffer* bound_read_framebuffer() const { |
| 254 return bound_read_framebuffer_.get(); |
| 255 } |
| 256 void SetBoundFramebuffer(GLenum target, Framebuffer* framebuffer); |
| 257 bool IsBindingDirty(GLenum target) const; |
| 258 void MarkBindingDirty(GLenum target); |
| 259 void MarkBindingClean(GLenum target); |
| 260 |
| 261 void NotifyFramebufferChanged(Framebuffer* framebuffer); |
| 262 void NotifyBoundFramebuffersChanged(); |
| 263 |
| 264 private: |
| 265 // OpenGL FBO bindings have been modified and do not reflect |
| 266 // bound_read_framebuffer and bound_draw_framebuffer. |
| 267 bool draw_binding_dirty_; |
| 268 bool read_binding_dirty_; |
238 | 269 |
239 // State saved for clearing so we can clear render buffers and then | 270 // State saved for clearing so we can clear render buffers and then |
240 // restore to these values. | 271 // restore to these values. |
241 bool clear_state_dirty; | 272 bool draw_framebuffer_clear_state_dirty_; |
242 | 273 |
243 // The currently bound framebuffers | 274 // The currently bound framebuffers |
244 scoped_refptr<Framebuffer> bound_read_framebuffer; | 275 scoped_refptr<Framebuffer> bound_read_framebuffer_; |
245 scoped_refptr<Framebuffer> bound_draw_framebuffer; | 276 scoped_refptr<Framebuffer> bound_draw_framebuffer_; |
246 }; | 277 }; |
247 | 278 |
248 // This class keeps track of the frambebuffers and their attached renderbuffers | 279 // This class keeps track of the frambebuffers and their attached renderbuffers |
249 // so we can correctly clear them. | 280 // so we can correctly clear them. |
250 class GPU_EXPORT FramebufferManager { | 281 class GPU_EXPORT FramebufferManager { |
251 public: | 282 public: |
252 FramebufferManager(uint32_t max_draw_buffers, | 283 FramebufferManager(uint32_t max_draw_buffers, |
253 uint32_t max_color_attachments, | 284 uint32_t max_color_attachments, |
254 ContextType context_type, | 285 ContextType context_type, |
255 const scoped_refptr<FramebufferCompletenessCache>& | 286 const scoped_refptr<FramebufferCompletenessCache>& |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 351 |
321 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; | 352 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; |
322 | 353 |
323 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 354 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
324 }; | 355 }; |
325 | 356 |
326 } // namespace gles2 | 357 } // namespace gles2 |
327 } // namespace gpu | 358 } // namespace gpu |
328 | 359 |
329 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 360 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
OLD | NEW |