Summary: | [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tim Horton <thorton> | ||||||
Component: | WebKit2 | Assignee: | Tim Horton <thorton> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andersca, bdakin, commit-queue, darin, sam, simon.fraser, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Tim Horton
2014-05-10 17:17:07 PDT
Created attachment 231245 [details]
patch
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.
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. Created attachment 231247 [details]
patch
Should we add a UIColor cache too, not just a CGColor cache? (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. |