| 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/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // Check all attachments are cleared | 115 // Check all attachments are cleared |
| 116 bool IsCleared() const; | 116 bool IsCleared() const; |
| 117 | 117 |
| 118 GLenum GetDrawBuffer(GLenum draw_buffer) const; | 118 GLenum GetDrawBuffer(GLenum draw_buffer) const; |
| 119 | 119 |
| 120 void SetDrawBuffers(GLsizei n, const GLenum* bufs); | 120 void SetDrawBuffers(GLsizei n, const GLenum* bufs); |
| 121 | 121 |
| 122 static void ClearFramebufferCompleteComboMap(); | 122 static void ClearFramebufferCompleteComboMap(); |
| 123 | 123 |
| 124 static bool AllowFramebufferComboCompleteMapForTesting() { |
| 125 return allow_framebuffer_combo_complete_map_; |
| 126 } |
| 127 |
| 124 private: | 128 private: |
| 125 friend class FramebufferManager; | 129 friend class FramebufferManager; |
| 126 friend class base::RefCounted<Framebuffer>; | 130 friend class base::RefCounted<Framebuffer>; |
| 127 | 131 |
| 128 ~Framebuffer(); | 132 ~Framebuffer(); |
| 129 | 133 |
| 130 void MarkAsDeleted(); | 134 void MarkAsDeleted(); |
| 131 | 135 |
| 132 void MarkAttachmentsAsCleared( | 136 void MarkAttachmentsAsCleared( |
| 133 RenderbufferManager* renderbuffer_manager, | 137 RenderbufferManager* renderbuffer_manager, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 157 unsigned framebuffer_complete_state_count_id_; | 161 unsigned framebuffer_complete_state_count_id_; |
| 158 | 162 |
| 159 // A map of attachments. | 163 // A map of attachments. |
| 160 typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap; | 164 typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap; |
| 161 AttachmentMap attachments_; | 165 AttachmentMap attachments_; |
| 162 | 166 |
| 163 // A map of successful frame buffer combos. If it's in the map | 167 // A map of successful frame buffer combos. If it's in the map |
| 164 // it should be FRAMEBUFFER_COMPLETE. | 168 // it should be FRAMEBUFFER_COMPLETE. |
| 165 typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap; | 169 typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap; |
| 166 static FramebufferComboCompleteMap* framebuffer_combo_complete_map_; | 170 static FramebufferComboCompleteMap* framebuffer_combo_complete_map_; |
| 171 static bool allow_framebuffer_combo_complete_map_; |
| 167 | 172 |
| 168 scoped_ptr<GLenum[]> draw_buffers_; | 173 scoped_ptr<GLenum[]> draw_buffers_; |
| 169 | 174 |
| 170 DISALLOW_COPY_AND_ASSIGN(Framebuffer); | 175 DISALLOW_COPY_AND_ASSIGN(Framebuffer); |
| 171 }; | 176 }; |
| 172 | 177 |
| 173 // This class keeps track of the frambebuffers and their attached renderbuffers | 178 // This class keeps track of the frambebuffers and their attached renderbuffers |
| 174 // so we can correctly clear them. | 179 // so we can correctly clear them. |
| 175 class GPU_EXPORT FramebufferManager { | 180 class GPU_EXPORT FramebufferManager { |
| 176 public: | 181 public: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 uint32 max_draw_buffers_; | 236 uint32 max_draw_buffers_; |
| 232 uint32 max_color_attachments_; | 237 uint32 max_color_attachments_; |
| 233 | 238 |
| 234 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 239 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
| 235 }; | 240 }; |
| 236 | 241 |
| 237 } // namespace gles2 | 242 } // namespace gles2 |
| 238 } // namespace gpu | 243 } // namespace gpu |
| 239 | 244 |
| 240 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 245 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| OLD | NEW |