OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 GLenum attachment, | 75 GLenum attachment, |
76 GLenum texTarget, | 76 GLenum texTarget, |
77 WebGLTexture*, | 77 WebGLTexture*, |
78 GLint level, | 78 GLint level, |
79 GLint layer); | 79 GLint layer); |
80 void setAttachmentForBoundFramebuffer(GLenum target, | 80 void setAttachmentForBoundFramebuffer(GLenum target, |
81 GLenum attachment, | 81 GLenum attachment, |
82 WebGLRenderbuffer*); | 82 WebGLRenderbuffer*); |
83 // If an object is attached to the currently bound framebuffer, remove it. | 83 // If an object is attached to the currently bound framebuffer, remove it. |
84 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*); | 84 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*); |
85 // If a given attachment point for the currently bound framebuffer is not null
, remove the attached object. | 85 // If a given attachment point for the currently bound framebuffer is not |
| 86 // null, remove the attached object. |
86 void removeAttachmentFromBoundFramebuffer(GLenum target, GLenum attachment); | 87 void removeAttachmentFromBoundFramebuffer(GLenum target, GLenum attachment); |
87 WebGLSharedObject* getAttachmentObject(GLenum) const; | 88 WebGLSharedObject* getAttachmentObject(GLenum) const; |
88 | 89 |
89 // WebGL 1 specific: | 90 // WebGL 1 specific: |
90 // 1) can't allow depth_stencil for depth/stencil attachments, and vice vers
a. | 91 // 1) can't allow depth_stencil for depth/stencil attachments, and vice |
| 92 // versa. |
91 // 2) no conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments. | 93 // 2) no conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments. |
92 GLenum checkDepthStencilStatus(const char** reason) const; | 94 GLenum checkDepthStencilStatus(const char** reason) const; |
93 | 95 |
94 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } | 96 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } |
95 | 97 |
96 void setHasEverBeenBound() { m_hasEverBeenBound = true; } | 98 void setHasEverBeenBound() { m_hasEverBeenBound = true; } |
97 | 99 |
98 bool hasStencilBuffer() const; | 100 bool hasStencilBuffer() const; |
99 | 101 |
100 // Wrapper for drawBuffersEXT/drawBuffersARB to work around a driver bug. | 102 // Wrapper for drawBuffersEXT/drawBuffersARB to work around a driver bug. |
(...skipping 18 matching lines...) Expand all Loading... |
119 | 121 |
120 private: | 122 private: |
121 WebGLAttachment* getAttachment(GLenum attachment) const; | 123 WebGLAttachment* getAttachment(GLenum attachment) const; |
122 | 124 |
123 // Check if the framebuffer is currently bound. | 125 // Check if the framebuffer is currently bound. |
124 bool isBound(GLenum target) const; | 126 bool isBound(GLenum target) const; |
125 | 127 |
126 // attach 'attachment' at 'attachmentPoint'. | 128 // attach 'attachment' at 'attachmentPoint'. |
127 void attach(GLenum target, GLenum attachment, GLenum attachmentPoint); | 129 void attach(GLenum target, GLenum attachment, GLenum attachmentPoint); |
128 | 130 |
129 // Check if a new drawBuffers call should be issued. This is called when we ad
d or remove an attachment. | 131 // Check if a new drawBuffers call should be issued. This is called when we |
| 132 // add or remove an attachment. |
130 void drawBuffersIfNecessary(bool force); | 133 void drawBuffersIfNecessary(bool force); |
131 | 134 |
132 GLuint m_object; | 135 GLuint m_object; |
133 | 136 |
134 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap; | 137 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap; |
135 | 138 |
136 AttachmentMap m_attachments; | 139 AttachmentMap m_attachments; |
137 bool m_destructionInProgress; | 140 bool m_destructionInProgress; |
138 | 141 |
139 bool m_hasEverBeenBound; | 142 bool m_hasEverBeenBound; |
140 | 143 |
141 Vector<GLenum> m_drawBuffers; | 144 Vector<GLenum> m_drawBuffers; |
142 Vector<GLenum> m_filteredDrawBuffers; | 145 Vector<GLenum> m_filteredDrawBuffers; |
143 | 146 |
144 GLenum m_readBuffer; | 147 GLenum m_readBuffer; |
145 }; | 148 }; |
146 | 149 |
147 } // namespace blink | 150 } // namespace blink |
148 | 151 |
149 #endif // WebGLFramebuffer_h | 152 #endif // WebGLFramebuffer_h |
OLD | NEW |