OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 typedef scoped_refptr<Attachment> Ref; | 30 typedef scoped_refptr<Attachment> Ref; |
31 | 31 |
32 virtual ~Attachment() { } | 32 virtual ~Attachment() { } |
33 virtual GLsizei width() const = 0; | 33 virtual GLsizei width() const = 0; |
34 virtual GLsizei height() const = 0; | 34 virtual GLsizei height() const = 0; |
35 virtual GLenum internal_format() const = 0; | 35 virtual GLenum internal_format() const = 0; |
36 virtual GLsizei samples() const = 0; | 36 virtual GLsizei samples() const = 0; |
37 virtual bool cleared() const = 0; | 37 virtual bool cleared() const = 0; |
38 virtual void set_cleared() = 0; | 38 virtual void set_cleared() = 0; |
| 39 virtual bool IsTexture(TextureManager::TextureInfo* texture) const = 0; |
39 }; | 40 }; |
40 | 41 |
41 explicit FramebufferInfo(GLuint service_id); | 42 explicit FramebufferInfo(GLuint service_id); |
42 | 43 |
43 GLuint service_id() const { | 44 GLuint service_id() const { |
44 return service_id_; | 45 return service_id_; |
45 } | 46 } |
46 | 47 |
47 bool HasUnclearedAttachment(GLenum attachment) const; | 48 bool HasUnclearedAttachment(GLenum attachment) const; |
48 | 49 |
(...skipping 16 matching lines...) Expand all Loading... |
65 } | 66 } |
66 | 67 |
67 void MarkAsValid() { | 68 void MarkAsValid() { |
68 has_been_bound_ = true; | 69 has_been_bound_ = true; |
69 } | 70 } |
70 | 71 |
71 bool IsValid() const { | 72 bool IsValid() const { |
72 return has_been_bound_ && !IsDeleted(); | 73 return has_been_bound_ && !IsDeleted(); |
73 } | 74 } |
74 | 75 |
| 76 bool HasDepthAttachment() const; |
| 77 bool HasStencilAttachment() const; |
| 78 GLenum GetColorAttachmentFormat() const; |
| 79 |
75 // We can't know if the frame buffer is complete since that is | 80 // We can't know if the frame buffer is complete since that is |
76 // implementation dependent and we'd have to check after every glTexImage | 81 // implementation dependent and we'd have to check after every glTexImage |
77 // call but we can know in certain cases that it's NOT complete which we | 82 // call but we can know in certain cases that it's NOT complete which we |
78 // need to enforce the OpenGL ES 2.0 spec on top of DesktopGL. | 83 // need to enforce the OpenGL ES 2.0 spec on top of DesktopGL. |
79 bool IsNotComplete() const; | 84 bool IsNotComplete() const; |
80 | 85 |
81 private: | 86 private: |
82 friend class FramebufferManager; | 87 friend class FramebufferManager; |
83 friend class base::RefCounted<FramebufferInfo>; | 88 friend class base::RefCounted<FramebufferInfo>; |
84 | 89 |
85 ~FramebufferInfo(); | 90 ~FramebufferInfo(); |
86 | 91 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 typedef base::hash_map<GLuint, FramebufferInfo::Ref> FramebufferInfoMap; | 130 typedef base::hash_map<GLuint, FramebufferInfo::Ref> FramebufferInfoMap; |
126 FramebufferInfoMap framebuffer_infos_; | 131 FramebufferInfoMap framebuffer_infos_; |
127 | 132 |
128 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 133 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
129 }; | 134 }; |
130 | 135 |
131 } // namespace gles2 | 136 } // namespace gles2 |
132 } // namespace gpu | 137 } // namespace gpu |
133 | 138 |
134 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 139 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
OLD | NEW |