RESOLVED FIXED 98660
RenderBoxModelObject::paintTranslucentBorderSides() creates needless transparency layers
https://bugs.webkit.org/show_bug.cgi?id=98660
Summary RenderBoxModelObject::paintTranslucentBorderSides() creates needless transpar...
Tom Hudson
Reported 2012-10-08 09:54:56 PDT
The code that computes useTransparencyLayer doesn't pay attention to edges[i].shouldRender(), but paintBorderSides() does. So we can call beginTransparencyLayer() and endTransparencyLayer() - which can cost tens of ms on some platforms if the layers are large - but render nothing to the layer we so carefully create and painstakingly blend.
Attachments
Simplified version of patch for testing (856 bytes, patch)
2012-10-09 04:22 PDT, Tom Hudson
no flags
Fix pathnames. (799 bytes, patch)
2012-10-09 04:32 PDT, Tom Hudson
no flags
Add Changelog. (1.68 KB, patch)
2012-10-09 05:11 PDT, Tom Hudson
no flags
Fix ChangeLog formatting. (1.85 KB, patch)
2012-10-09 05:23 PDT, Tom Hudson
no flags
Alternate implementation in paintBorder() instead of paintTranslucentBorderSides() (1.92 KB, patch)
2012-10-09 08:37 PDT, Tom Hudson
no flags
After out-of-band review, moving the implementation back to paintTranslucentBorderSides(), but reversing the flag-application logic for reasability (2.17 KB, patch)
2012-10-09 10:14 PDT, Tom Hudson
no flags
Patch (5.65 KB, patch)
2012-11-15 09:23 PST, Tom Hudson
no flags
Patch (5.49 KB, patch)
2012-11-19 04:24 PST, Tom Hudson
no flags
Tom Hudson
Comment 1 2012-10-09 04:22:33 PDT
Created attachment 167731 [details] Simplified version of patch for testing
Tom Hudson
Comment 2 2012-10-09 04:32:04 PDT
Created attachment 167734 [details] Fix pathnames.
Tom Hudson
Comment 3 2012-10-09 05:11:53 PDT
Created attachment 167739 [details] Add Changelog.
WebKit Review Bot
Comment 4 2012-10-09 05:15:12 PDT
Attachment 167739 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Source/WebCore/ChangeLog:11: Need whitespace between colon and description [changelog/filechangedescriptionwhitespace] [5] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tom Hudson
Comment 5 2012-10-09 05:23:13 PDT
Created attachment 167741 [details] Fix ChangeLog formatting.
Tom Hudson
Comment 6 2012-10-09 08:37:11 PDT
Created attachment 167761 [details] Alternate implementation in paintBorder() instead of paintTranslucentBorderSides() Early-out higher up the callstack, so we do even less unnecessary work.
Tom Hudson
Comment 7 2012-10-09 10:14:34 PDT
Created attachment 167776 [details] After out-of-band review, moving the implementation back to paintTranslucentBorderSides(), but reversing the flag-application logic for reasability
Simon Fraser (smfr)
Comment 8 2012-10-09 10:32:29 PDT
Comment on attachment 167776 [details] After out-of-band review, moving the implementation back to paintTranslucentBorderSides(), but reversing the flag-application logic for reasability I think it would be slightly better for RenderBoxModelObject::paintBorder() to compute edgesToDraw in its existing loop through the edges. edgesToDraw could then be passed to paintTranslucentBorderSides() and paintBorderSides().
Tom Hudson
Comment 9 2012-11-15 09:23:20 PST
Simon Fraser (smfr)
Comment 10 2012-11-15 11:21:12 PST
Comment on attachment 174464 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=174464&action=review > Source/WebCore/rendering/RenderBoxModelObject.cpp:1963 > + BorderEdgeFlags edgesToDraw = 0; > + for (int i = BSTop; i <= BSLeft; ++i) > + if (edges[i].shouldRender()) > + edgesToDraw |= edgeFlagForSide(static_cast<BoxSide>(i)); I don't like changing the value of input parameters. Why is this necessary here?
Tom Hudson
Comment 11 2012-11-15 11:41:23 PST
(In reply to comment #10) > (From update of attachment 174464 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=174464&action=review > > > Source/WebCore/rendering/RenderBoxModelObject.cpp:1963 > > + BorderEdgeFlags edgesToDraw = 0; > > + for (int i = BSTop; i <= BSLeft; ++i) > > + if (edges[i].shouldRender()) > > + edgesToDraw |= edgeFlagForSide(static_cast<BoxSide>(i)); > > I don't like changing the value of input parameters. Why is this necessary here? Simon, I'm not sure I understand your comment. edgesToDraw is not an input to paintBorder(). It was previously not an input to paintTransparentBorderSides(); you r-ed my previous the version in #8 and requested that I compute it in paintBorder() and pass it down. We were previously always passing AllBorderEdges to paintBorderSides(); I thought in #8 you were asking me to pass down the more-precise version.
Simon Fraser (smfr)
Comment 12 2012-11-15 11:46:57 PST
Sorry the review diff page confused me. This seems OK, but please upload a patch that applies cleanly.
Tom Hudson
Comment 13 2012-11-19 04:24:13 PST
Tom Hudson
Comment 14 2012-11-19 06:39:13 PST
Comment on attachment 174948 [details] Patch Simon, patch applies this time and seems to be doing well in EWS.
WebKit Review Bot
Comment 15 2012-11-19 08:57:25 PST
Comment on attachment 174948 [details] Patch Clearing flags on attachment: 174948 Committed r135167: <http://trac.webkit.org/changeset/135167>
WebKit Review Bot
Comment 16 2012-11-19 08:57:29 PST
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.