RESOLVED FIXED Bug 44064
GraphicsContext3D::reshape is clearing using current clear color instead of transparent
https://bugs.webkit.org/show_bug.cgi?id=44064
Summary GraphicsContext3D::reshape is clearing using current clear color instead of t...
Dave Hyatt
Reported 2010-08-16 11:00:35 PDT
The WebGL spec says when you resize the canvas (what happens in our reshape call), the buffer should be cleared and filled with transparent. We're incorrectly filling with the current clear color instead.
Attachments
patch (13.69 KB, patch)
2010-11-18 16:30 PST, Zhenyao Mo
kbr: review-
zmo: commit-queue-
revised patch (13.69 KB, patch)
2010-11-19 09:04 PST, Zhenyao Mo
kbr: review+
zmo: commit-queue-
Kenneth Russell
Comment 1 2010-08-16 12:47:38 PDT
The bug is in GraphicsContext3DMac.mm. It should be querying the clear color, setting it to (0, 0, 0, 0) before the clear call, and resetting it afterward.
Chris Marrin
Comment 2 2010-08-16 13:34:09 PDT
(In reply to comment #1) > The bug is in GraphicsContext3DMac.mm. It should be querying the clear color, setting it to (0, 0, 0, 0) before the clear call, and resetting it afterward. Yes, this is why I took the bug. Because it is so simple :-)
Chris Marrin
Comment 3 2010-08-16 13:34:47 PDT
(In reply to comment #2) > (In reply to comment #1) > > The bug is in GraphicsContext3DMac.mm. It should be querying the clear color, setting it to (0, 0, 0, 0) before the clear call, and resetting it afterward. > > Yes, this is why I took the bug. Because it is so simple :-) But on a serious note, the test case should be testing this, but it's not. I will add this test to the testcase as well.
Zhenyao Mo
Comment 4 2010-08-16 13:49:05 PDT
I guess Ken assigned to me because my code caused the bug. Since you are working on it, I am assigning it back to you.
Zhenyao Mo
Comment 5 2010-11-18 12:12:33 PST
This bug is blocking texture/renderbuffer initialization patch in WebCore/graphics/gpu/DrawingBuffer.cpp:reset().
Zhenyao Mo
Comment 6 2010-11-18 16:30:01 PST
Created attachment 74318 [details] patch Will modify khornos's side of the test once it's reviewed here.
Kenneth Russell
Comment 7 2010-11-18 18:21:43 PST
Comment on attachment 74318 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=74318&action=review Looks good. Apologies but we decided to change the clear depth upon resizing to the default value (1.0) rather than 0.0 on today's WebGL conference call, so would appreciate it if you could fix that up in these changes. > WebCore/platform/graphics/gpu/DrawingBuffer.cpp:183 > + m_context->clearDepth(0); Per discussion on today's WebGL conference call, we should use the default clear depth, which is 1.0. The spec's been updated with this change. > WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:227 > + ::glClearDepth(0); Here too. > WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp:455 > + glClearDepth(0); Here too.
Zhenyao Mo
Comment 8 2010-11-19 09:04:32 PST
Created attachment 74397 [details] revised patch depth clear value all set to 1.
Kenneth Russell
Comment 9 2010-11-19 12:13:30 PST
Comment on attachment 74397 [details] revised patch Looks good to me.
Zhenyao Mo
Comment 10 2010-11-19 13:04:23 PST
Note You need to log in before you can comment on or make changes to this bug.