RESOLVED FIXED 132793
[WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
https://bugs.webkit.org/show_bug.cgi?id=132793
Summary [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
Tim Horton
Reported 2014-05-10 17:17:07 PDT
Every layer tree commit, we churn various different color objects in _updateScrollViewBackground. There's no reason for this, and it's a complete waste of ~2.5% of the UI process time while repainting quickly.
Attachments
patch (2.73 KB, patch)
2014-05-10 20:20 PDT, Tim Horton
no flags
patch (3.90 KB, patch)
2014-05-10 20:54 PDT, Tim Horton
mitz: review+
Radar WebKit Bug Importer
Comment 1 2014-05-10 17:17:31 PDT
Tim Horton
Comment 2 2014-05-10 20:20:35 PDT
WebKit Commit Bot
Comment 3 2014-05-10 20:22:21 PDT
Attachment 231245 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:455: The parameter name "_currentScrollViewBackgroundColor" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
mitz
Comment 4 2014-05-10 20:48:31 PDT
Comment on attachment 231245 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=231245&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:129 > + WebCore::Color _currentScrollViewBackgroundColor; What does the word “current” add here? > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:452 > + color = WebCore::Color(color.red(), color.green(), color.blue(), opacity * 255); opacity * 255 is not rounding correctly. If you use colorWithOverrideAlpha() from Color.h you’ll get the correct rounding behavior. Something like: color.setRGB(colorWithOverrideAlpha(color.rgb(), opacity); > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:455 > + if (_currentScrollViewBackgroundColor.isValid() && _currentScrollViewBackgroundColor == color) Color’s operator== compares validity, so I don’t understand what the isValid() check here is doing.
Tim Horton
Comment 5 2014-05-10 20:54:32 PDT
Tim Horton
Comment 6 2014-05-10 20:57:52 PDT
Darin Adler
Comment 7 2014-05-11 10:40:06 PDT
Should we add a UIColor cache too, not just a CGColor cache?
Tim Horton
Comment 8 2014-05-11 10:53:20 PDT
(In reply to comment #7) > Should we add a UIColor cache too, not just a CGColor cache? Maybe! Though, with this resolved, I don't see UIColor creation being slow anywhere in traces.
Note You need to log in before you can comment on or make changes to this bug.