| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual bool Is3D() const = 0; | 55 virtual bool Is3D() const = 0; |
| 56 virtual bool CanRenderTo(const FeatureInfo* feature_info) const = 0; | 56 virtual bool CanRenderTo(const FeatureInfo* feature_info) const = 0; |
| 57 virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const = 0; | 57 virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const = 0; |
| 58 virtual bool ValidForAttachmentType(GLenum attachment_type, | 58 virtual bool ValidForAttachmentType(GLenum attachment_type, |
| 59 ContextType context_type, | 59 ContextType context_type, |
| 60 uint32_t max_color_attachments) = 0; | 60 uint32_t max_color_attachments) = 0; |
| 61 virtual size_t GetSignatureSize(TextureManager* texture_manager) const = 0; | 61 virtual size_t GetSignatureSize(TextureManager* texture_manager) const = 0; |
| 62 virtual void AddToSignature( | 62 virtual void AddToSignature( |
| 63 TextureManager* texture_manager, std::string* signature) const = 0; | 63 TextureManager* texture_manager, std::string* signature) const = 0; |
| 64 virtual bool FormsFeedbackLoop(TextureRef* texture, GLint level) const = 0; | 64 virtual bool FormsFeedbackLoop(TextureRef* texture, GLint level) const = 0; |
| 65 virtual bool EmulatingRGB() const = 0; |
| 66 |
| 67 virtual bool Initialized() const = 0; |
| 68 virtual void SetInitialized(bool initialized) = 0; |
| 65 | 69 |
| 66 protected: | 70 protected: |
| 67 friend class base::RefCounted<Attachment>; | 71 friend class base::RefCounted<Attachment>; |
| 68 virtual ~Attachment() {} | 72 virtual ~Attachment() {} |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 Framebuffer(FramebufferManager* manager, GLuint service_id); | 75 Framebuffer(FramebufferManager* manager, GLuint service_id); |
| 72 | 76 |
| 73 GLuint service_id() const { | 77 GLuint service_id() const { |
| 74 return service_id_; | 78 return service_id_; |
| 75 } | 79 } |
| 76 | 80 |
| 77 bool HasUnclearedAttachment(GLenum attachment) const; | 81 bool HasUnclearedAttachment(GLenum attachment) const; |
| 78 bool HasUnclearedColorAttachments() const; | 82 bool HasUnclearedColorAttachments() const; |
| 83 bool HasUninitializedDrawBuffers() const; |
| 84 void SetDrawBuffersAsInitialized(); |
| 79 | 85 |
| 80 void ClearUnclearedIntOr3DTexturesOrPartiallyClearedTextures( | 86 void ClearUnclearedIntOr3DTexturesOrPartiallyClearedTextures( |
| 81 GLES2Decoder* decoder, | 87 GLES2Decoder* decoder, |
| 82 TextureManager* texture_manager); | 88 TextureManager* texture_manager); |
| 83 | 89 |
| 84 bool HasUnclearedIntRenderbufferAttachments() const; | 90 bool HasUnclearedIntRenderbufferAttachments() const; |
| 85 | 91 |
| 86 void ClearUnclearedIntRenderbufferAttachments( | 92 void ClearUnclearedIntRenderbufferAttachments( |
| 87 RenderbufferManager* renderbuffer_manager); | 93 RenderbufferManager* renderbuffer_manager); |
| 88 | 94 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // draw buffer for glClear(). | 171 // draw buffer for glClear(). |
| 166 // Return true if the DrawBuffers() is actually called. | 172 // Return true if the DrawBuffers() is actually called. |
| 167 bool PrepareDrawBuffersForClear() const; | 173 bool PrepareDrawBuffersForClear() const; |
| 168 | 174 |
| 169 // Restore draw buffers states that have been changed in | 175 // Restore draw buffers states that have been changed in |
| 170 // PrepareDrawBuffersForClear(). | 176 // PrepareDrawBuffersForClear(). |
| 171 void RestoreDrawBuffersAfterClear() const; | 177 void RestoreDrawBuffersAfterClear() const; |
| 172 | 178 |
| 173 // Return true if any draw buffers has an alpha channel. | 179 // Return true if any draw buffers has an alpha channel. |
| 174 bool HasAlphaMRT() const; | 180 bool HasAlphaMRT() const; |
| 181 bool EmulatingRGB() const; |
| 175 | 182 |
| 176 // Return false if any two active color attachments have different internal | 183 // Return false if any two active color attachments have different internal |
| 177 // formats. | 184 // formats. |
| 178 bool HasSameInternalFormatsMRT() const; | 185 bool HasSameInternalFormatsMRT() const; |
| 179 | 186 |
| 180 void set_read_buffer(GLenum read_buffer) { | 187 void set_read_buffer(GLenum read_buffer) { |
| 181 read_buffer_ = read_buffer; | 188 read_buffer_ = read_buffer; |
| 182 } | 189 } |
| 183 | 190 |
| 184 GLenum read_buffer() const { | 191 GLenum read_buffer() const { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 326 |
| 320 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; | 327 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; |
| 321 | 328 |
| 322 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 329 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
| 323 }; | 330 }; |
| 324 | 331 |
| 325 } // namespace gles2 | 332 } // namespace gles2 |
| 326 } // namespace gpu | 333 } // namespace gpu |
| 327 | 334 |
| 328 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 335 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| OLD | NEW |