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