Index: Source/core/html/canvas/WebGLFramebuffer.cpp |
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp |
index e968a306e5d313c7c07dbe191b3f2466b1c4135b..2701c406cebce8928a75ab9a65ec978254f97ca0 100644 |
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp |
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp |
@@ -41,10 +41,14 @@ namespace { |
class WebGLRenderbufferAttachment FINAL : public WebGLFramebuffer::WebGLAttachment { |
public: |
- static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLRenderbuffer*); |
+ static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLRenderbuffer*); |
+ |
+ virtual void trace(Visitor*) OVERRIDE; |
private: |
- WebGLRenderbufferAttachment(WebGLRenderbuffer*); |
+ explicit WebGLRenderbufferAttachment(WebGLRenderbuffer*); |
+ WebGLRenderbufferAttachment() { } |
+ |
virtual GLsizei width() const OVERRIDE; |
virtual GLsizei height() const OVERRIDE; |
virtual GLenum format() const OVERRIDE; |
@@ -56,14 +60,18 @@ namespace { |
virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE; |
virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE; |
- WebGLRenderbufferAttachment() { }; |
- |
- RefPtr<WebGLRenderbuffer> m_renderbuffer; |
+ RefPtrWillBeMember<WebGLRenderbuffer> m_renderbuffer; |
}; |
- PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferAttachment::create(WebGLRenderbuffer* renderbuffer) |
+ PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferAttachment::create(WebGLRenderbuffer* renderbuffer) |
+ { |
+ return adoptRefWillBeNoop(new WebGLRenderbufferAttachment(renderbuffer)); |
+ } |
+ |
+ void WebGLRenderbufferAttachment::trace(Visitor* visitor) |
{ |
- return adoptRef(new WebGLRenderbufferAttachment(renderbuffer)); |
+ visitor->trace(m_renderbuffer); |
+ WebGLFramebuffer::WebGLAttachment::trace(visitor); |
} |
WebGLRenderbufferAttachment::WebGLRenderbufferAttachment(WebGLRenderbuffer* renderbuffer) |
@@ -141,10 +149,14 @@ namespace { |
class WebGLTextureAttachment FINAL : public WebGLFramebuffer::WebGLAttachment { |
public: |
- static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLTexture*, GLenum target, GLint level); |
+ static PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLTexture*, GLenum target, GLint level); |
+ |
+ virtual void trace(Visitor*) OVERRIDE; |
private: |
WebGLTextureAttachment(WebGLTexture*, GLenum target, GLint level); |
+ WebGLTextureAttachment() { } |
+ |
virtual GLsizei width() const OVERRIDE; |
virtual GLsizei height() const OVERRIDE; |
virtual GLenum format() const OVERRIDE; |
@@ -156,16 +168,20 @@ namespace { |
virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE; |
virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE; |
- WebGLTextureAttachment() { }; |
- |
- RefPtr<WebGLTexture> m_texture; |
+ RefPtrWillBeMember<WebGLTexture> m_texture; |
GLenum m_target; |
GLint m_level; |
}; |
- PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttachment::create(WebGLTexture* texture, GLenum target, GLint level) |
+ PassRefPtrWillBeRawPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttachment::create(WebGLTexture* texture, GLenum target, GLint level) |
+ { |
+ return adoptRefWillBeNoop(new WebGLTextureAttachment(texture, target, level)); |
+ } |
+ |
+ void WebGLTextureAttachment::trace(Visitor* visitor) |
{ |
- return adoptRef(new WebGLTextureAttachment(texture, target, level)); |
+ visitor->trace(m_texture); |
+ WebGLFramebuffer::WebGLAttachment::trace(visitor); |
} |
WebGLTextureAttachment::WebGLTextureAttachment(WebGLTexture* texture, GLenum target, GLint level) |
@@ -253,9 +269,9 @@ WebGLFramebuffer::WebGLAttachment::~WebGLAttachment() |
{ |
} |
-PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContextBase* ctx) |
+PassRefPtrWillBeRawPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContextBase* ctx) |
{ |
- return adoptRef(new WebGLFramebuffer(ctx)); |
+ return adoptRefWillBeNoop(new WebGLFramebuffer(ctx)); |
} |
WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx) |
@@ -268,6 +284,7 @@ WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx) |
WebGLFramebuffer::~WebGLFramebuffer() |
{ |
+ detach(); |
deleteObject(0); |
haraken
2014/07/15 15:04:56
Can we add a helper function that does detach() an
sof
2014/07/15 16:23:00
Will do.
sof
2014/07/15 21:49:07
Done.
|
} |
@@ -539,8 +556,10 @@ bool WebGLFramebuffer::hasStencilBuffer() const |
void WebGLFramebuffer::deleteObjectImpl(blink::WebGraphicsContext3D* context3d, Platform3DObject object) |
{ |
+#if !ENABLE(OILPAN) |
for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) |
it->value->onDetached(context3d); |
haraken
2014/07/15 15:04:56
Would you elaborate on why we don't need to call o
sof
2014/07/15 16:23:00
Attachment objects are WebGLSharedObjects. These w
|
+#endif |
context3d->deleteFramebuffer(object); |
} |
@@ -595,4 +614,10 @@ GLenum WebGLFramebuffer::getDrawBuffer(GLenum drawBuffer) |
return GL_NONE; |
} |
+void WebGLFramebuffer::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_attachments); |
+ WebGLContextObject::trace(visitor); |
+} |
+ |
} |