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

Unified Diff: Source/WebCore/html/canvas/WebGLFramebuffer.cpp

Issue 10584035: Merge 120636 - Fix framebuffer-object-attachment.html failures (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « Source/WebCore/html/canvas/WebGLFramebuffer.h ('k') | Source/WebCore/html/canvas/WebGLRenderingContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/canvas/WebGLFramebuffer.cpp
===================================================================
--- Source/WebCore/html/canvas/WebGLFramebuffer.cpp (revision 120837)
+++ Source/WebCore/html/canvas/WebGLFramebuffer.cpp (working copy)
@@ -128,7 +128,7 @@
void WebGLRenderbufferAttachment::unattach(GraphicsContext3D* context, GC3Denum attachment)
{
- if (attachment == GraphicsContext3D::DEPTH_STENCIL) {
+ if (attachment == GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT) {
context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, 0);
context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, 0);
} else
@@ -283,11 +283,10 @@
void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3Denum texTarget, WebGLTexture* texture, GC3Dint level)
{
ASSERT(isBound());
+ removeAttachmentFromBoundFramebuffer(attachment);
if (!object())
return;
- removeAttachmentFromBoundFramebuffer(attachment);
if (texture && texture->object()) {
-
m_attachments.add(attachment, WebGLTextureAttachment::create(texture, texTarget, level));
texture->onAttached();
}
@@ -296,9 +295,9 @@
void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GC3Denum attachment, WebGLRenderbuffer* renderbuffer)
{
ASSERT(isBound());
+ removeAttachmentFromBoundFramebuffer(attachment);
if (!object())
return;
- removeAttachmentFromBoundFramebuffer(attachment);
if (renderbuffer && renderbuffer->object()) {
m_attachments.add(attachment, WebGLRenderbufferAttachment::create(renderbuffer));
renderbuffer->onAttached();
@@ -337,6 +336,18 @@
if (attachmentObject) {
attachmentObject->onDetached(context()->graphicsContext3D());
m_attachments.remove(attachment);
+ switch (attachment) {
+ case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+ attach(GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::DEPTH_ATTACHMENT);
+ attach(GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::STENCIL_ATTACHMENT);
+ break;
+ case GraphicsContext3D::DEPTH_ATTACHMENT:
+ attach(GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT, GraphicsContext3D::DEPTH_ATTACHMENT);
+ break;
+ case GraphicsContext3D::STENCIL_ATTACHMENT:
+ attach(GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT, GraphicsContext3D::STENCIL_ATTACHMENT);
+ break;
+ }
}
}
« no previous file with comments | « Source/WebCore/html/canvas/WebGLFramebuffer.h ('k') | Source/WebCore/html/canvas/WebGLRenderingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698