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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual void SetCleared( | 39 virtual void SetCleared( |
40 RenderbufferManager* renderbuffer_manager, | 40 RenderbufferManager* renderbuffer_manager, |
41 TextureManager* texture_manager, | 41 TextureManager* texture_manager, |
42 bool cleared) = 0; | 42 bool cleared) = 0; |
43 virtual bool IsTexture(TextureRef* texture) const = 0; | 43 virtual bool IsTexture(TextureRef* texture) const = 0; |
44 virtual bool IsRenderbuffer( | 44 virtual bool IsRenderbuffer( |
45 Renderbuffer* renderbuffer) const = 0; | 45 Renderbuffer* renderbuffer) const = 0; |
46 virtual bool CanRenderTo() const = 0; | 46 virtual bool CanRenderTo() const = 0; |
47 virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const = 0; | 47 virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const = 0; |
48 virtual bool ValidForAttachmentType( | 48 virtual bool ValidForAttachmentType( |
49 GLenum attachment_type, uint32 max_color_attachments) = 0; | 49 GLenum attachment_type, uint32 max_color_attachments, |
| 50 bool allow_float_color_attachment) = 0; |
50 virtual void AddToSignature( | 51 virtual void AddToSignature( |
51 TextureManager* texture_manager, std::string* signature) const = 0; | 52 TextureManager* texture_manager, std::string* signature) const = 0; |
52 | 53 |
53 protected: | 54 protected: |
54 friend class base::RefCounted<Attachment>; | 55 friend class base::RefCounted<Attachment>; |
55 virtual ~Attachment() {} | 56 virtual ~Attachment() {} |
56 }; | 57 }; |
57 | 58 |
58 Framebuffer(FramebufferManager* manager, GLuint service_id); | 59 Framebuffer(FramebufferManager* manager, GLuint service_id); |
59 | 60 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // returns 0. | 109 // returns 0. |
109 GLenum GetColorAttachmentTextureType() const; | 110 GLenum GetColorAttachmentTextureType() const; |
110 | 111 |
111 // Verify all the rules in OpenGL ES 2.0.25 4.4.5 are followed. | 112 // Verify all the rules in OpenGL ES 2.0.25 4.4.5 are followed. |
112 // Returns GL_FRAMEBUFFER_COMPLETE if there are no reasons we know we can't | 113 // Returns GL_FRAMEBUFFER_COMPLETE if there are no reasons we know we can't |
113 // use this combination of attachments. Otherwise returns the value | 114 // use this combination of attachments. Otherwise returns the value |
114 // that glCheckFramebufferStatus should return for this set of attachments. | 115 // that glCheckFramebufferStatus should return for this set of attachments. |
115 // Note that receiving GL_FRAMEBUFFER_COMPLETE from this function does | 116 // Note that receiving GL_FRAMEBUFFER_COMPLETE from this function does |
116 // not mean the real OpenGL will consider it framebuffer complete. It just | 117 // not mean the real OpenGL will consider it framebuffer complete. It just |
117 // means it passed our tests. | 118 // means it passed our tests. |
118 GLenum IsPossiblyComplete() const; | 119 GLenum IsPossiblyComplete(bool allow_float_color_attachment) const; |
119 | 120 |
120 // Implements optimized glGetFramebufferStatus. | 121 // Implements optimized glGetFramebufferStatus. |
121 GLenum GetStatus(TextureManager* texture_manager, GLenum target) const; | 122 GLenum GetStatus(TextureManager* texture_manager, GLenum target) const; |
122 | 123 |
123 // Check all attachments are cleared | 124 // Check all attachments are cleared |
124 bool IsCleared() const; | 125 bool IsCleared() const; |
125 | 126 |
126 GLenum GetDrawBuffer(GLenum draw_buffer) const; | 127 GLenum GetDrawBuffer(GLenum draw_buffer) const; |
127 | 128 |
128 void SetDrawBuffers(GLsizei n, const GLenum* bufs); | 129 void SetDrawBuffers(GLsizei n, const GLenum* bufs); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 typedef std::vector<TextureDetachObserver*> TextureDetachObserverVector; | 291 typedef std::vector<TextureDetachObserver*> TextureDetachObserverVector; |
291 TextureDetachObserverVector texture_detach_observers_; | 292 TextureDetachObserverVector texture_detach_observers_; |
292 | 293 |
293 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 294 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
294 }; | 295 }; |
295 | 296 |
296 } // namespace gles2 | 297 } // namespace gles2 |
297 } // namespace gpu | 298 } // namespace gpu |
298 | 299 |
299 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 300 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
OLD | NEW |