| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 Platform3DObject objectOrZero(WebGLObject* object) | 39 Platform3DObject objectOrZero(WebGLObject* object) |
| 40 { | 40 { |
| 41 return object ? object->object() : 0; | 41 return object ? object->object() : 0; |
| 42 } | 42 } |
| 43 | 43 |
| 44 class WebGLRenderbufferAttachment final : public WebGLFramebuffer::WebGLAtta
chment { | 44 class WebGLRenderbufferAttachment final : public WebGLFramebuffer::WebGLAtta
chment { |
| 45 public: | 45 public: |
| 46 static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(
WebGLRenderbuffer*); | 46 static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(
WebGLRenderbuffer*); |
| 47 | 47 |
| 48 virtual void trace(Visitor*) override; | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 explicit WebGLRenderbufferAttachment(WebGLRenderbuffer*); | 51 explicit WebGLRenderbufferAttachment(WebGLRenderbuffer*); |
| 52 WebGLRenderbufferAttachment() { } | 52 WebGLRenderbufferAttachment() { } |
| 53 | 53 |
| 54 virtual GLsizei width() const override; | 54 virtual GLsizei width() const override; |
| 55 virtual GLsizei height() const override; | 55 virtual GLsizei height() const override; |
| 56 virtual GLenum format() const override; | 56 virtual GLenum format() const override; |
| 57 virtual GLenum type() const override; | 57 virtual GLenum type() const override; |
| 58 virtual WebGLSharedObject* object() const override; | 58 virtual WebGLSharedObject* object() const override; |
| 59 virtual bool isSharedObject(WebGLSharedObject*) const override; | 59 virtual bool isSharedObject(WebGLSharedObject*) const override; |
| 60 virtual bool valid() const override; | 60 virtual bool valid() const override; |
| 61 virtual void onDetached(blink::WebGraphicsContext3D*) override; | 61 virtual void onDetached(blink::WebGraphicsContext3D*) override; |
| 62 virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) ove
rride; | 62 virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) ove
rride; |
| 63 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) o
verride; | 63 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) o
verride; |
| 64 | 64 |
| 65 RefPtrWillBeMember<WebGLRenderbuffer> m_renderbuffer; | 65 RefPtrWillBeMember<WebGLRenderbuffer> m_renderbuffer; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferA
ttachment::create(WebGLRenderbuffer* renderbuffer) | 68 PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferA
ttachment::create(WebGLRenderbuffer* renderbuffer) |
| 69 { | 69 { |
| 70 return adoptRefWillBeNoop(new WebGLRenderbufferAttachment(renderbuffer))
; | 70 return adoptRefWillBeNoop(new WebGLRenderbufferAttachment(renderbuffer))
; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WebGLRenderbufferAttachment::trace(Visitor* visitor) | 73 DEFINE_TRACE(WebGLRenderbufferAttachment) |
| 74 { | 74 { |
| 75 visitor->trace(m_renderbuffer); | 75 visitor->trace(m_renderbuffer); |
| 76 WebGLFramebuffer::WebGLAttachment::trace(visitor); | 76 WebGLFramebuffer::WebGLAttachment::trace(visitor); |
| 77 } | 77 } |
| 78 | 78 |
| 79 WebGLRenderbufferAttachment::WebGLRenderbufferAttachment(WebGLRenderbuffer*
renderbuffer) | 79 WebGLRenderbufferAttachment::WebGLRenderbufferAttachment(WebGLRenderbuffer*
renderbuffer) |
| 80 : m_renderbuffer(renderbuffer) | 80 : m_renderbuffer(renderbuffer) |
| 81 { | 81 { |
| 82 } | 82 } |
| 83 | 83 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 GLenum WebGLRenderbufferAttachment::type() const | 146 GLenum WebGLRenderbufferAttachment::type() const |
| 147 { | 147 { |
| 148 notImplemented(); | 148 notImplemented(); |
| 149 return 0; | 149 return 0; |
| 150 } | 150 } |
| 151 | 151 |
| 152 class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachmen
t { | 152 class WebGLTextureAttachment final : public WebGLFramebuffer::WebGLAttachmen
t { |
| 153 public: | 153 public: |
| 154 static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(
WebGLTexture*, GLenum target, GLint level); | 154 static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(
WebGLTexture*, GLenum target, GLint level); |
| 155 | 155 |
| 156 virtual void trace(Visitor*) override; | 156 DECLARE_VIRTUAL_TRACE(); |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 WebGLTextureAttachment(WebGLTexture*, GLenum target, GLint level); | 159 WebGLTextureAttachment(WebGLTexture*, GLenum target, GLint level); |
| 160 WebGLTextureAttachment() { } | 160 WebGLTextureAttachment() { } |
| 161 | 161 |
| 162 virtual GLsizei width() const override; | 162 virtual GLsizei width() const override; |
| 163 virtual GLsizei height() const override; | 163 virtual GLsizei height() const override; |
| 164 virtual GLenum format() const override; | 164 virtual GLenum format() const override; |
| 165 virtual GLenum type() const override; | 165 virtual GLenum type() const override; |
| 166 virtual WebGLSharedObject* object() const override; | 166 virtual WebGLSharedObject* object() const override; |
| 167 virtual bool isSharedObject(WebGLSharedObject*) const override; | 167 virtual bool isSharedObject(WebGLSharedObject*) const override; |
| 168 virtual bool valid() const override; | 168 virtual bool valid() const override; |
| 169 virtual void onDetached(blink::WebGraphicsContext3D*) override; | 169 virtual void onDetached(blink::WebGraphicsContext3D*) override; |
| 170 virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) ove
rride; | 170 virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) ove
rride; |
| 171 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) o
verride; | 171 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) o
verride; |
| 172 | 172 |
| 173 RefPtrWillBeMember<WebGLTexture> m_texture; | 173 RefPtrWillBeMember<WebGLTexture> m_texture; |
| 174 GLenum m_target; | 174 GLenum m_target; |
| 175 GLint m_level; | 175 GLint m_level; |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttach
ment::create(WebGLTexture* texture, GLenum target, GLint level) | 178 PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttach
ment::create(WebGLTexture* texture, GLenum target, GLint level) |
| 179 { | 179 { |
| 180 return adoptRefWillBeNoop(new WebGLTextureAttachment(texture, target, le
vel)); | 180 return adoptRefWillBeNoop(new WebGLTextureAttachment(texture, target, le
vel)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void WebGLTextureAttachment::trace(Visitor* visitor) | 183 DEFINE_TRACE(WebGLTextureAttachment) |
| 184 { | 184 { |
| 185 visitor->trace(m_texture); | 185 visitor->trace(m_texture); |
| 186 WebGLFramebuffer::WebGLAttachment::trace(visitor); | 186 WebGLFramebuffer::WebGLAttachment::trace(visitor); |
| 187 } | 187 } |
| 188 | 188 |
| 189 WebGLTextureAttachment::WebGLTextureAttachment(WebGLTexture* texture, GLenum
target, GLint level) | 189 WebGLTextureAttachment::WebGLTextureAttachment(WebGLTexture* texture, GLenum
target, GLint level) |
| 190 : m_texture(texture) | 190 : m_texture(texture) |
| 191 , m_target(target) | 191 , m_target(target) |
| 192 , m_level(level) | 192 , m_level(level) |
| 193 { | 193 { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 { | 624 { |
| 625 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); | 625 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); |
| 626 ASSERT(index >= 0); | 626 ASSERT(index >= 0); |
| 627 if (index < static_cast<int>(m_drawBuffers.size())) | 627 if (index < static_cast<int>(m_drawBuffers.size())) |
| 628 return m_drawBuffers[index]; | 628 return m_drawBuffers[index]; |
| 629 if (drawBuffer == GL_DRAW_BUFFER0_EXT) | 629 if (drawBuffer == GL_DRAW_BUFFER0_EXT) |
| 630 return GL_COLOR_ATTACHMENT0; | 630 return GL_COLOR_ATTACHMENT0; |
| 631 return GL_NONE; | 631 return GL_NONE; |
| 632 } | 632 } |
| 633 | 633 |
| 634 void WebGLFramebuffer::trace(Visitor* visitor) | 634 DEFINE_TRACE(WebGLFramebuffer) |
| 635 { | 635 { |
| 636 #if ENABLE(OILPAN) | 636 #if ENABLE(OILPAN) |
| 637 visitor->trace(m_attachments); | 637 visitor->trace(m_attachments); |
| 638 #endif | 638 #endif |
| 639 WebGLContextObject::trace(visitor); | 639 WebGLContextObject::trace(visitor); |
| 640 } | 640 } |
| 641 | 641 |
| 642 } | 642 } |
| OLD | NEW |