RESOLVED FIXED 60750
Optimize outline rendering to avoid transparency layers
https://bugs.webkit.org/show_bug.cgi?id=60750
Summary Optimize outline rendering to avoid transparency layers
Ben Wells
Reported 2011-05-12 20:39:03 PDT
Simple cases of borders and outlines, such as where all sides are the same color, are SOLID style, and don't have rounded corners, could easily be optimized to avoid using expensive transparency layers.
Attachments
Patch (3.42 KB, patch)
2011-11-03 20:38 PDT, David Barr
no flags
Patch (3.33 KB, patch)
2011-11-03 20:50 PDT, David Barr
no flags
Patch (20.21 KB, patch)
2011-11-05 05:33 PDT, David Barr
no flags
David Barr
Comment 1 2011-11-03 20:38:48 PDT
David Barr
Comment 2 2011-11-03 20:50:28 PDT
WebKit Review Bot
Comment 3 2011-11-03 21:26:09 PDT
Comment on attachment 113618 [details] Patch Attachment 113618 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10314046 New failing tests: fast/box-shadow/box-shadow-radius.html fast/layers/self-painting-outline.html
David Barr
Comment 4 2011-11-03 21:54:09 PDT
> New failing tests: > fast/box-shadow/box-shadow-radius.html > fast/layers/self-painting-outline.html These will likely need to be rebaselined due to Skia rounding differently for layered vs direct alpha paints.
Darin Adler
Comment 5 2011-11-04 10:13:38 PDT
Comment on attachment 113618 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113618&action=review > Source/WebCore/rendering/RenderObject.cpp:1145 > + if (outlineStyle == SOLID && outlineColor.hasAlpha()) { I think this code needs a why comment. If you look at just this code, it's surprising that we have a special case just for the case where we have alpha. A good way to make that clear is to put this optimization inside the "use transparency layer" if statement. There it is easy to see that we are avoiding an expensive transparency layer. Otherwise, it is unclear why there is no fast case for the case where we don’t have alpha. The reason is that the code is already fast, and this alternate implemenation would probably be slower, in cases where we are not making a transparency layer. So you could just add a comment, or you could even put this entire fast case inside the useTransparencyLayer if statement, or you could at least use the useTransparencyLayer boolean to trigger this fast case. I think the key is that this is an optimization because it avoids the transparency layer and the code should make this crystal clear.
David Barr
Comment 6 2011-11-05 05:33:45 PDT
David Barr
Comment 7 2011-11-05 05:37:32 PDT
Comment on attachment 113752 [details] Patch Moved the short path inside the useTransparencyLayer test for clarity. Updated pixel tests for chromium-linux due to subtle change in alpha rounding with direct paint vs transparency layers.
WebKit Review Bot
Comment 8 2011-11-07 12:19:07 PST
Comment on attachment 113752 [details] Patch Clearing flags on attachment: 113752 Committed r99454: <http://trac.webkit.org/changeset/99454>
WebKit Review Bot
Comment 9 2011-11-07 12:19:12 PST
All reviewed patches have been landed. Closing bug.
noel gordon
Comment 10 2011-11-08 13:04:45 PST
Note You need to log in before you can comment on or make changes to this bug.