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 23 matching lines...) Expand all Loading... |
34 class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> { | 34 class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> { |
35 public: | 35 public: |
36 class Attachment : public base::RefCounted<Attachment> { | 36 class Attachment : public base::RefCounted<Attachment> { |
37 public: | 37 public: |
38 virtual GLsizei width() const = 0; | 38 virtual GLsizei width() const = 0; |
39 virtual GLsizei height() const = 0; | 39 virtual GLsizei height() const = 0; |
40 virtual GLenum internal_format() const = 0; | 40 virtual GLenum internal_format() const = 0; |
41 virtual GLenum texture_type() const = 0; | 41 virtual GLenum texture_type() const = 0; |
42 virtual GLsizei samples() const = 0; | 42 virtual GLsizei samples() const = 0; |
43 virtual GLuint object_name() const = 0; | 43 virtual GLuint object_name() const = 0; |
| 44 virtual GLenum attachment() const = 0; |
44 virtual bool cleared() const = 0; | 45 virtual bool cleared() const = 0; |
45 virtual void SetCleared( | 46 virtual void SetCleared( |
46 RenderbufferManager* renderbuffer_manager, | 47 RenderbufferManager* renderbuffer_manager, |
47 TextureManager* texture_manager, | 48 TextureManager* texture_manager, |
48 bool cleared) = 0; | 49 bool cleared) = 0; |
| 50 virtual bool IsDepthStencil() const = 0; |
49 virtual bool IsPartiallyCleared() const = 0; | 51 virtual bool IsPartiallyCleared() const = 0; |
50 virtual bool IsTextureAttachment() const = 0; | 52 virtual bool IsTextureAttachment() const = 0; |
51 virtual bool IsRenderbufferAttachment() const = 0; | 53 virtual bool IsRenderbufferAttachment() const = 0; |
52 virtual bool IsTexture(TextureRef* texture) const = 0; | 54 virtual bool IsTexture(TextureRef* texture) const = 0; |
53 virtual bool IsRenderbuffer( | 55 virtual bool IsRenderbuffer( |
54 Renderbuffer* renderbuffer) const = 0; | 56 Renderbuffer* renderbuffer) const = 0; |
55 virtual bool Is3D() const = 0; | 57 virtual bool Is3D() const = 0; |
56 | 58 |
57 // If it's a 3D texture attachment, return true if | 59 // If it's a 3D texture attachment, return true if |
58 // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is smaller than the number of | 60 // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is smaller than the number of |
(...skipping 18 matching lines...) Expand all Loading... |
77 | 79 |
78 Framebuffer(FramebufferManager* manager, GLuint service_id); | 80 Framebuffer(FramebufferManager* manager, GLuint service_id); |
79 | 81 |
80 GLuint service_id() const { | 82 GLuint service_id() const { |
81 return service_id_; | 83 return service_id_; |
82 } | 84 } |
83 | 85 |
84 bool HasUnclearedAttachment(GLenum attachment) const; | 86 bool HasUnclearedAttachment(GLenum attachment) const; |
85 bool HasUnclearedColorAttachments() const; | 87 bool HasUnclearedColorAttachments() const; |
86 | 88 |
| 89 static bool IsDepthStencilFormat(GLenum internal_format) { |
| 90 return internal_format == GL_DEPTH24_STENCIL8 || |
| 91 internal_format == GL_DEPTH32F_STENCIL8; |
| 92 } |
| 93 |
87 bool HasSRGBAttachments() const; | 94 bool HasSRGBAttachments() const; |
88 | 95 |
89 void ClearUnclearedIntOr3DTexturesOrPartiallyClearedTextures( | 96 void ClearUnclearedIntOr3DTexturesOrPartiallyClearedTextures( |
90 GLES2Decoder* decoder, | 97 GLES2Decoder* decoder, |
91 TextureManager* texture_manager); | 98 TextureManager* texture_manager); |
92 | 99 |
93 bool HasUnclearedIntRenderbufferAttachments() const; | 100 bool HasUnclearedIntRenderbufferAttachments() const; |
94 | 101 |
95 void ClearUnclearedIntRenderbufferAttachments( | 102 void ClearUnclearedIntRenderbufferAttachments( |
96 RenderbufferManager* renderbuffer_manager); | 103 RenderbufferManager* renderbuffer_manager); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 340 |
334 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; | 341 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; |
335 | 342 |
336 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 343 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
337 }; | 344 }; |
338 | 345 |
339 } // namespace gles2 | 346 } // namespace gles2 |
340 } // namespace gpu | 347 } // namespace gpu |
341 | 348 |
342 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 349 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
OLD | NEW |