| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap; | 174 typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap; |
| 175 static FramebufferComboCompleteMap* framebuffer_combo_complete_map_; | 175 static FramebufferComboCompleteMap* framebuffer_combo_complete_map_; |
| 176 static bool allow_framebuffer_combo_complete_map_; | 176 static bool allow_framebuffer_combo_complete_map_; |
| 177 | 177 |
| 178 scoped_ptr<GLenum[]> draw_buffers_; | 178 scoped_ptr<GLenum[]> draw_buffers_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(Framebuffer); | 180 DISALLOW_COPY_AND_ASSIGN(Framebuffer); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 struct DecoderFramebufferState { | 183 struct DecoderFramebufferState { |
| 184 DecoderFramebufferState(): | 184 DecoderFramebufferState(); |
| 185 clear_state_dirty(true) {} | 185 ~DecoderFramebufferState(); |
| 186 | 186 |
| 187 // State saved for clearing so we can clear render buffers and then | 187 // State saved for clearing so we can clear render buffers and then |
| 188 // restore to these values. | 188 // restore to these values. |
| 189 bool clear_state_dirty; | 189 bool clear_state_dirty; |
| 190 |
| 191 // The currently bound framebuffers |
| 192 scoped_refptr<Framebuffer> bound_read_framebuffer; |
| 193 scoped_refptr<Framebuffer> bound_draw_framebuffer; |
| 190 }; | 194 }; |
| 191 | 195 |
| 192 // This class keeps track of the frambebuffers and their attached renderbuffers | 196 // This class keeps track of the frambebuffers and their attached renderbuffers |
| 193 // so we can correctly clear them. | 197 // so we can correctly clear them. |
| 194 class GPU_EXPORT FramebufferManager { | 198 class GPU_EXPORT FramebufferManager { |
| 195 public: | 199 public: |
| 196 FramebufferManager(uint32 max_draw_buffers, uint32 max_color_attachments); | 200 FramebufferManager(uint32 max_draw_buffers, uint32 max_color_attachments); |
| 197 ~FramebufferManager(); | 201 ~FramebufferManager(); |
| 198 | 202 |
| 199 // Must call before destruction. | 203 // Must call before destruction. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 uint32 max_draw_buffers_; | 254 uint32 max_draw_buffers_; |
| 251 uint32 max_color_attachments_; | 255 uint32 max_color_attachments_; |
| 252 | 256 |
| 253 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 257 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
| 254 }; | 258 }; |
| 255 | 259 |
| 256 } // namespace gles2 | 260 } // namespace gles2 |
| 257 } // namespace gpu | 261 } // namespace gpu |
| 258 | 262 |
| 259 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 263 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| OLD | NEW |