| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return m_renderbuffer->object(); | 85 return m_renderbuffer->object(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WebGLRenderbufferAttachment::onDetached(gpu::gles2::GLES2Interface* gl) | 88 void WebGLRenderbufferAttachment::onDetached(gpu::gles2::GLES2Interface* gl) |
| 89 { | 89 { |
| 90 m_renderbuffer->onDetached(gl); | 90 m_renderbuffer->onDetached(gl); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void WebGLRenderbufferAttachment::attach(gpu::gles2::GLES2Interface* gl, GLenum
target, GLenum attachment) | 93 void WebGLRenderbufferAttachment::attach(gpu::gles2::GLES2Interface* gl, GLenum
target, GLenum attachment) |
| 94 { | 94 { |
| 95 Platform3DObject object = objectOrZero(m_renderbuffer.get()); | 95 GLuint object = objectOrZero(m_renderbuffer.get()); |
| 96 gl->FramebufferRenderbuffer(target, attachment, GL_RENDERBUFFER, object); | 96 gl->FramebufferRenderbuffer(target, attachment, GL_RENDERBUFFER, object); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void WebGLRenderbufferAttachment::unattach(gpu::gles2::GLES2Interface* gl, GLenu
m target, GLenum attachment) | 99 void WebGLRenderbufferAttachment::unattach(gpu::gles2::GLES2Interface* gl, GLenu
m target, GLenum attachment) |
| 100 { | 100 { |
| 101 gl->FramebufferRenderbuffer(target, attachment, GL_RENDERBUFFER, 0); | 101 gl->FramebufferRenderbuffer(target, attachment, GL_RENDERBUFFER, 0); |
| 102 } | 102 } |
| 103 | 103 |
| 104 class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachment { | 104 class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachment { |
| 105 public: | 105 public: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return m_texture->object(); | 158 return m_texture->object(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void WebGLTextureAttachment::onDetached(gpu::gles2::GLES2Interface* gl) | 161 void WebGLTextureAttachment::onDetached(gpu::gles2::GLES2Interface* gl) |
| 162 { | 162 { |
| 163 m_texture->onDetached(gl); | 163 m_texture->onDetached(gl); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void WebGLTextureAttachment::attach(gpu::gles2::GLES2Interface* gl, GLenum targe
t, GLenum attachment) | 166 void WebGLTextureAttachment::attach(gpu::gles2::GLES2Interface* gl, GLenum targe
t, GLenum attachment) |
| 167 { | 167 { |
| 168 Platform3DObject object = objectOrZero(m_texture.get()); | 168 GLuint object = objectOrZero(m_texture.get()); |
| 169 if (m_target == GL_TEXTURE_3D || m_target == GL_TEXTURE_2D_ARRAY) { | 169 if (m_target == GL_TEXTURE_3D || m_target == GL_TEXTURE_2D_ARRAY) { |
| 170 gl->FramebufferTextureLayer(target, attachment, object, m_level, m_layer
); | 170 gl->FramebufferTextureLayer(target, attachment, object, m_level, m_layer
); |
| 171 } else { | 171 } else { |
| 172 gl->FramebufferTexture2D(target, attachment, m_target, object, m_level); | 172 gl->FramebufferTexture2D(target, attachment, m_target, object, m_level); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void WebGLTextureAttachment::unattach(gpu::gles2::GLES2Interface* gl, GLenum tar
get, GLenum attachment) | 176 void WebGLTextureAttachment::unattach(gpu::gles2::GLES2Interface* gl, GLenum tar
get, GLenum attachment) |
| 177 { | 177 { |
| 178 // GL_DEPTH_STENCIL_ATTACHMENT attachment is valid in ES3. | 178 // GL_DEPTH_STENCIL_ATTACHMENT attachment is valid in ES3. |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return GL_NONE; | 422 return GL_NONE; |
| 423 } | 423 } |
| 424 | 424 |
| 425 DEFINE_TRACE(WebGLFramebuffer) | 425 DEFINE_TRACE(WebGLFramebuffer) |
| 426 { | 426 { |
| 427 visitor->trace(m_attachments); | 427 visitor->trace(m_attachments); |
| 428 WebGLContextObject::trace(visitor); | 428 WebGLContextObject::trace(visitor); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |