Bug 68087

Summary: [chromium] CSS 3D drawing artifacts
Product: WebKit Reporter: David Reveman <reveman>
Component: WebCore Misc.Assignee: David Reveman <reveman>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, enne, jamesr, shawnsingh, vangelis, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Layout test
none
Patch
none
Patch
none
Patch
none
Patch none

David Reveman
Reported 2011-09-14 09:53:23 PDT
There seems to be some instability in the edge calculation code used for anti-aliasing. Artifacts are visible in this page: http://css-class.com/test/css/3/transform-color-cube3.htm I don't have a layout test top reproduce this yet. Working on it.
Attachments
Layout test (8.99 KB, patch)
2011-09-16 07:19 PDT, David Reveman
no flags
Patch (50.59 KB, patch)
2011-09-16 11:19 PDT, David Reveman
no flags
Patch (50.94 KB, patch)
2011-09-16 14:31 PDT, David Reveman
no flags
Patch (49.63 KB, patch)
2011-09-23 10:51 PDT, David Reveman
no flags
Patch (50.06 KB, patch)
2011-09-23 10:58 PDT, David Reveman
no flags
David Reveman
Comment 1 2011-09-16 07:19:17 PDT
Created attachment 107648 [details] Layout test
David Reveman
Comment 2 2011-09-16 11:19:08 PDT
David Reveman
Comment 3 2011-09-16 14:31:56 PDT
Vangelis Kokkevis
Comment 4 2011-09-21 12:10:09 PDT
Comment on attachment 107723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=107723&action=review Looks good. One possible suggestion for simplifying the shaders a bit. Also in the new 3d-corners test, the obtuse angle of the triangle looks a bit flattened. Is that expected? > Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp:321 > + gl_FragColor = texColor * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); Would it make sense to pass in the edge info as two mat4's and replace the 8 dot products and clamps by 2 matrix-vector multiplies and 2 clamps?
David Reveman
Comment 5 2011-09-21 14:27:19 PDT
Comment on attachment 107723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=107723&action=review >> Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp:321 >> + gl_FragColor = texColor * alpha * min(min(a0, a2) * min(a1, a3), min(a4, a6) * min(a5, a7)); > > Would it make sense to pass in the edge info as two mat4's and replace the 8 dot products and clamps by 2 matrix-vector multiplies and 2 clamps? Not sure that would buy us anything. I think the clamps to [0.0-1.0] range are basically free on most GPUs. I guess it's possible that two mat4/vec4 multiplies are more efficient than 8 dot3 ops on some GPUs even though it theoretically requires more math. I would prefer to keep the current code as using mat4 would require more uniforms and make the intentions of the code a bit more obscure.
David Reveman
Comment 6 2011-09-22 08:29:35 PDT
(In reply to comment #4) > (From update of attachment 107723 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=107723&action=review > > Looks good. One possible suggestion for simplifying the shaders a bit. Also in the new 3d-corners test, the obtuse angle of the triangle looks a bit flattened. Is that expected? Sorry, I missed this question in my last reply. The alpha value at the end of these sharp corners is not perfect. Actually the only time this method produces alpha values that perfectly matches coverage-based anti-aliasing is for 90 degree angles. All other angles will be slightly off but usually close enough that it's not really noticeable. The corners in the 3d-corners test are pushing this to the extreme.
Vangelis Kokkevis
Comment 7 2011-09-23 10:15:16 PDT
(In reply to comment #6) > (In reply to comment #4) > > (From update of attachment 107723 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=107723&action=review > > > > Looks good. One possible suggestion for simplifying the shaders a bit. Also in the new 3d-corners test, the obtuse angle of the triangle looks a bit flattened. Is that expected? > > Sorry, I missed this question in my last reply. The alpha value at the end of these sharp corners is not perfect. Actually the only time this method produces alpha values that perfectly matches coverage-based anti-aliasing is for 90 degree angles. All other angles will be slightly off but usually close enough that it's not really noticeable. The corners in the 3d-corners test are pushing this to the extreme. Sounds good. You're probably right about the shader performance issue as well. Unofficial r+ from me.
James Robinson
Comment 8 2011-09-23 10:19:32 PDT
Comment on attachment 107723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=107723&action=review Then official R=me. Fix the test and this is ready to land. > LayoutTests/platform/chromium/compositing/3d-corners-expected.txt:3 > +layer at (0,0) size 800x856 > + RenderView at (0,0) size 800x600 > +layer at (0,0) size 800x600 you shouldn't have a render tree dump since it doesn't reveal anything interesting about this test. instead add this to the <script> of your test: if (window.layoutTestController) layoutTestController.dumpAsText(true);
David Reveman
Comment 9 2011-09-23 10:51:17 PDT
James Robinson
Comment 10 2011-09-23 10:56:03 PDT
Comment on attachment 108492 [details] Patch Close, you still need to add 3d-corners-expected.txt (even though it's just one newline) or the test will fail on the bots.
David Reveman
Comment 11 2011-09-23 10:58:47 PDT
James Robinson
Comment 12 2011-09-23 11:01:07 PDT
Comment on attachment 108495 [details] Patch That's the ticket.
WebKit Review Bot
Comment 13 2011-09-23 11:52:20 PDT
Comment on attachment 108495 [details] Patch Attachment 108495 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9822129 New failing tests: svg/custom/svg-fonts-word-spacing.html
WebKit Review Bot
Comment 14 2011-09-23 15:28:01 PDT
Comment on attachment 108495 [details] Patch Clearing flags on attachment: 108495 Committed r95870: <http://trac.webkit.org/changeset/95870>
WebKit Review Bot
Comment 15 2011-09-23 15:28:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.