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 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 // Info about Framebuffers currently in the system. | 24 // Info about Framebuffers currently in the system. |
25 class GPU_EXPORT FramebufferInfo : public base::RefCounted<FramebufferInfo> { | 25 class GPU_EXPORT FramebufferInfo : public base::RefCounted<FramebufferInfo> { |
26 public: | 26 public: |
27 typedef scoped_refptr<FramebufferInfo> Ref; | 27 typedef scoped_refptr<FramebufferInfo> Ref; |
28 | 28 |
29 class Attachment : public base::RefCounted<Attachment> { | 29 class Attachment : public base::RefCounted<Attachment> { |
30 public: | 30 public: |
31 typedef scoped_refptr<Attachment> Ref; | 31 typedef scoped_refptr<Attachment> Ref; |
32 | 32 |
33 virtual ~Attachment() { } | |
34 virtual GLsizei width() const = 0; | 33 virtual GLsizei width() const = 0; |
35 virtual GLsizei height() const = 0; | 34 virtual GLsizei height() const = 0; |
36 virtual GLenum internal_format() const = 0; | 35 virtual GLenum internal_format() const = 0; |
37 virtual GLsizei samples() const = 0; | 36 virtual GLsizei samples() const = 0; |
38 virtual bool cleared() const = 0; | 37 virtual bool cleared() const = 0; |
39 virtual void SetCleared( | 38 virtual void SetCleared( |
40 RenderbufferManager* renderbuffer_manager, | 39 RenderbufferManager* renderbuffer_manager, |
41 TextureManager* texture_manager) = 0; | 40 TextureManager* texture_manager) = 0; |
42 virtual bool IsTexture(TextureManager::TextureInfo* texture) const = 0; | 41 virtual bool IsTexture(TextureManager::TextureInfo* texture) const = 0; |
43 virtual bool IsRenderbuffer( | 42 virtual bool IsRenderbuffer( |
44 RenderbufferManager::RenderbufferInfo* renderbuffer) const = 0; | 43 RenderbufferManager::RenderbufferInfo* renderbuffer) const = 0; |
45 virtual bool CanRenderTo() const = 0; | 44 virtual bool CanRenderTo() const = 0; |
46 virtual void DetachFromFramebuffer() = 0; | 45 virtual void DetachFromFramebuffer() = 0; |
47 virtual bool ValidForAttachmentType(GLenum attachment_type) = 0; | 46 virtual bool ValidForAttachmentType(GLenum attachment_type) = 0; |
| 47 |
| 48 protected: |
| 49 friend class base::RefCounted<Attachment>; |
| 50 virtual ~Attachment() {} |
48 }; | 51 }; |
49 | 52 |
50 FramebufferInfo(FramebufferManager* manager, GLuint service_id); | 53 FramebufferInfo(FramebufferManager* manager, GLuint service_id); |
51 | 54 |
52 GLuint service_id() const { | 55 GLuint service_id() const { |
53 return service_id_; | 56 return service_id_; |
54 } | 57 } |
55 | 58 |
56 bool HasUnclearedAttachment(GLenum attachment) const; | 59 bool HasUnclearedAttachment(GLenum attachment) const; |
57 | 60 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 198 |
196 bool have_context_; | 199 bool have_context_; |
197 | 200 |
198 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 201 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
199 }; | 202 }; |
200 | 203 |
201 } // namespace gles2 | 204 } // namespace gles2 |
202 } // namespace gpu | 205 } // namespace gpu |
203 | 206 |
204 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 207 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
OLD | NEW |