Index: Source/core/html/canvas/WebGLFramebuffer.h |
diff --git a/Source/core/html/canvas/WebGLFramebuffer.h b/Source/core/html/canvas/WebGLFramebuffer.h |
index f15ae11db68379276210d8d5091a95b5b065b57c..c37b0d79f493ee690d88fe7bbf43a7677cc1bafd 100644 |
--- a/Source/core/html/canvas/WebGLFramebuffer.h |
+++ b/Source/core/html/canvas/WebGLFramebuffer.h |
@@ -55,8 +55,8 @@ public: |
virtual bool isSharedObject(WebGLSharedObject*) const = 0; |
virtual bool valid() const = 0; |
virtual void onDetached(WebGraphicsContext3D*) = 0; |
- virtual void attach(WebGraphicsContext3D*, GLenum attachment) = 0; |
- virtual void unattach(WebGraphicsContext3D*, GLenum attachment) = 0; |
+ virtual void attach(WebGraphicsContext3D*, GLenum target, GLenum attachment) = 0; |
+ virtual void unattach(WebGraphicsContext3D*, GLenum target, GLenum attachment) = 0; |
DEFINE_INLINE_VIRTUAL_TRACE() { } |
@@ -70,12 +70,12 @@ public: |
Platform3DObject object() const { return m_object; } |
- void setAttachmentForBoundFramebuffer(GLenum attachment, GLenum texTarget, WebGLTexture*, GLint level); |
- void setAttachmentForBoundFramebuffer(GLenum attachment, WebGLRenderbuffer*); |
+ void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, GLenum texTarget, WebGLTexture*, GLint level); |
+ void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, WebGLRenderbuffer*); |
// If an object is attached to the currently bound framebuffer, remove it. |
- void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*); |
+ void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*, GLenum target); |
// If a given attachment point for the currently bound framebuffer is not null, remove the attached object. |
- void removeAttachmentFromBoundFramebuffer(GLenum); |
+ void removeAttachmentFromBoundFramebuffer(GLenum, GLenum); |
WebGLSharedObject* getAttachmentObject(GLenum) const; |
GLenum colorBufferFormat() const; |
@@ -84,13 +84,13 @@ public: |
// readPixels, copyTexImage2D, copyTexSubImage2D if this framebuffer is |
// currently bound. |
// Return false if the framebuffer is incomplete. |
- bool onAccess(WebGraphicsContext3D*, const char** reason); |
+ bool onAccess(WebGraphicsContext3D*, GLenum target, const char** reason); |
// Software version of glCheckFramebufferStatus(), except that when |
// FRAMEBUFFER_COMPLETE is returned, it is still possible for |
// glCheckFramebufferStatus() to return FRAMEBUFFER_UNSUPPORTED, |
// depending on hardware implementation. |
- GLenum checkStatus(const char** reason) const; |
+ GLenum checkStatus(const char** reason, GLenum target) const; |
bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } |
@@ -112,14 +112,14 @@ protected: |
void deleteObjectImpl(WebGraphicsContext3D*) override; |
private: |
- WebGLAttachment* getAttachment(GLenum) const; |
+ WebGLAttachment* getAttachment(GLenum target, GLenum attachment) const; |
bool isAttachmentComplete(WebGLAttachment* attachedObject, GLenum attachment, const char** reason) const; |
// Check if the framebuffer is currently bound. |
bool isBound() const; |
// attach 'attachment' at 'attachmentPoint'. |
- void attach(GLenum attachment, GLenum attachmentPoint); |
+ void attach(GLenum target, GLenum attachment, GLenum attachmentPoint); |
// Check if a new drawBuffers call should be issued. This is called when we add or remove an attachment. |
void drawBuffersIfNecessary(bool force); |
@@ -129,6 +129,7 @@ private: |
typedef WillBeHeapHashMap<GLenum, RefPtrWillBeMember<WebGLAttachment>> AttachmentMap; |
AttachmentMap m_attachments; |
+ AttachmentMap m_attachmentsForReadFramebuffer; |
Ken Russell (switch to Gerrit)
2015/05/22 21:45:46
This still doesn't model the OpenGL state correctl
yunchao
2015/05/25 08:01:19
I got it. WebGLFramebuffer don't have attachments
|
bool m_hasEverBeenBound; |