Changeset 244554 in webkit
- Timestamp:
- Apr 23, 2019 12:13:48 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244546 r244554 1 2019-04-23 Timothy Hatcher <timothy@apple.com> 2 3 Speed up RenderTheme::systemColor on Speedometer2. 4 https://bugs.webkit.org/show_bug.cgi?id=197203 5 rdar://problem/50056756 6 7 Reviewed by Tim Horton. 8 9 * rendering/RenderThemeIOS.mm: 10 (WebCore::RenderThemeIOS::systemColor const): Remove some unused code. And fetch the cache after an early return. 11 * rendering/RenderThemeMac.mm: 12 (WebCore::RenderThemeMac::systemColor const): Avoid some allocations in LocalDefaultSystemAppearance 13 when a CSS color is in the system color cache. 14 1 15 2019-04-23 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r241825 r244554 1419 1419 Color RenderThemeIOS::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::Options> options) const 1420 1420 { 1421 const bool useSystemAppearance = options.contains(StyleColor::Options::UseSystemAppearance);1422 1421 const bool forVisitedLink = options.contains(StyleColor::Options::ForVisitedLink); 1423 1424 auto& cache = colorCache(options);1425 1426 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/RenderThemeIOSSystemColorAdditions.mm>)1427 #include <WebKitAdditions/RenderThemeIOSSystemColorAdditions.mm>1428 #endif1429 1422 1430 1423 // The system color cache below can't handle visited links. The only color value … … 1434 1427 return RenderTheme::systemColor(cssValueID, options); 1435 1428 1436 ASSERT_UNUSED(useSystemAppearance, !useSystemAppearance);1437 1429 ASSERT(!forVisitedLink); 1438 1430 1431 auto& cache = colorCache(options); 1439 1432 return cache.systemStyleColors.ensure(cssValueID, [this, cssValueID, options] () -> Color { 1433 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/RenderThemeIOSSystemColorAdditions.mm>) 1434 #include <WebKitAdditions/RenderThemeIOSSystemColorAdditions.mm> 1435 #endif 1436 1440 1437 auto cssColorToSelector = [cssValueID] () -> SEL { 1441 1438 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/RenderThemeIOSColorToSelectorAdditions.mm>) -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r242325 r244554 605 605 const bool forVisitedLink = options.contains(StyleColor::Options::ForVisitedLink); 606 606 607 LocalDefaultSystemAppearance localAppearance(useDarkAppearance);608 609 607 auto& cache = colorCache(options); 610 608 611 609 if (useSystemAppearance) { 612 610 // Special handling for links and other system colors when the system appearance is desired. 613 auto systemAppearanceColor = [ ] (Color& color, SEL selector) -> Color {611 auto systemAppearanceColor = [useDarkAppearance] (Color& color, SEL selector) -> Color { 614 612 if (!color.isValid()) { 613 LocalDefaultSystemAppearance localAppearance(useDarkAppearance); 615 614 auto systemColor = wtfObjCMsgSend<NSColor *>([NSColor class], selector); 616 615 color = semanticColorFromNSColor(systemColor); … … 663 662 ASSERT(!forVisitedLink); 664 663 665 return cache.systemStyleColors.ensure(cssValueID, [this, cssValueID, options, &localAppearance] () -> Color { 664 return cache.systemStyleColors.ensure(cssValueID, [this, cssValueID, options, useDarkAppearance] () -> Color { 665 LocalDefaultSystemAppearance localAppearance(useDarkAppearance); 666 666 667 auto selectCocoaColor = [cssValueID] () -> SEL { 667 668 switch (cssValueID) {
Note: See TracChangeset
for help on using the changeset viewer.