| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 bool hasObject() const override { return m_object != 0; } | 116 bool hasObject() const override { return m_object != 0; } |
| 117 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override; | 117 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override; |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 WebGLAttachment* getAttachment(GLenum attachment) const; | 120 WebGLAttachment* getAttachment(GLenum attachment) const; |
| 121 | 121 |
| 122 // Check if the framebuffer is currently bound. | 122 // Check if the framebuffer is currently bound. |
| 123 bool isBound(GLenum target) const; | 123 bool isBound(GLenum target) const; |
| 124 | 124 |
| 125 // Check if a new drawBuffers call should be issued. This is called when we ad
d or remove an attachment. | 125 // Check if a new drawBuffers call should be issued. This is called when we |
| 126 // add or remove an attachment. |
| 126 void drawBuffersIfNecessary(bool force); | 127 void drawBuffersIfNecessary(bool force); |
| 127 | 128 |
| 128 void setAttachmentInternal(GLenum target, | 129 void setAttachmentInternal(GLenum target, |
| 129 GLenum attachment, | 130 GLenum attachment, |
| 130 GLenum texTarget, | 131 GLenum texTarget, |
| 131 WebGLTexture*, | 132 WebGLTexture*, |
| 132 GLint level, | 133 GLint level, |
| 133 GLint layer); | 134 GLint layer); |
| 134 void setAttachmentInternal(GLenum target, | 135 void setAttachmentInternal(GLenum target, |
| 135 GLenum attachment, | 136 GLenum attachment, |
| 136 WebGLRenderbuffer*); | 137 WebGLRenderbuffer*); |
| 137 // If a given attachment point for the currently bound framebuffer is not null
, remove the attached object. | 138 // If a given attachment point for the currently bound framebuffer is not |
| 139 // null, remove the attached object. |
| 138 void removeAttachmentInternal(GLenum target, GLenum attachment); | 140 void removeAttachmentInternal(GLenum target, GLenum attachment); |
| 139 | 141 |
| 140 void commitWebGL1DepthStencilIfConsistent(GLenum target); | 142 void commitWebGL1DepthStencilIfConsistent(GLenum target); |
| 141 | 143 |
| 142 GLuint m_object; | 144 GLuint m_object; |
| 143 | 145 |
| 144 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap; | 146 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap; |
| 145 | 147 |
| 146 AttachmentMap m_attachments; | 148 AttachmentMap m_attachments; |
| 147 bool m_destructionInProgress; | 149 bool m_destructionInProgress; |
| 148 | 150 |
| 149 bool m_hasEverBeenBound; | 151 bool m_hasEverBeenBound; |
| 150 bool m_webGL1DepthStencilConsistent; | 152 bool m_webGL1DepthStencilConsistent; |
| 151 | 153 |
| 152 Vector<GLenum> m_drawBuffers; | 154 Vector<GLenum> m_drawBuffers; |
| 153 Vector<GLenum> m_filteredDrawBuffers; | 155 Vector<GLenum> m_filteredDrawBuffers; |
| 154 | 156 |
| 155 GLenum m_readBuffer; | 157 GLenum m_readBuffer; |
| 156 }; | 158 }; |
| 157 | 159 |
| 158 } // namespace blink | 160 } // namespace blink |
| 159 | 161 |
| 160 #endif // WebGLFramebuffer_h | 162 #endif // WebGLFramebuffer_h |
| OLD | NEW |