Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: Source/core/html/canvas/WebGLFramebuffer.h

Issue 1120953002: WebGL 2: add read/write framebuffer binding points to related APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..de819cda782ef57f054a1d86f6bd441e319fcd94 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 = GL_FRAMEBUFFER);
bajones 2015/05/06 17:47:53 I realize why you did it this way, because it cuts
yunchao 2015/05/22 09:54:35 Acknowledged.
// 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*, const char** reason, GLenum target = GL_FRAMEBUFFER);
// 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 attachment, GLenum target = GL_FRAMEBUFFER) 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_readAttachments;
Ken Russell (switch to Gerrit) 2015/05/06 21:17:33 This is not how framebuffer attachments work. An i
yunchao 2015/05/22 09:54:35 Yes. I know that FBO doesn't have "read" and "draw
bool m_hasEverBeenBound;

Powered by Google App Engine
This is Rietveld 408576698