Changeset 247626 in webkit


Ignore:
Timestamp:
Jul 18, 2019 5:07:52 PM (5 years ago)
Author:
pvollan@apple.com
Message:

Prewarm font cache with more fonts
https://bugs.webkit.org/show_bug.cgi?id=199283

Reviewed by Myles C. Maxfield.

Initialize the list of families requiring system fallback in the prewarming information struct, since
this was part of the original, approved patch, and is needed for the performance improvement.

No new tests, covered by existing tests.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::fontFamiliesForPrewarming):
(WebCore::FontCache::prewarmGlobally):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247624 r247626  
     12019-07-18  Per Arne Vollan  <pvollan@apple.com>
     2
     3        Prewarm font cache with more fonts
     4        https://bugs.webkit.org/show_bug.cgi?id=199283
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        Initialize the list of families requiring system fallback in the prewarming information struct, since
     9        this was part of the original, approved patch, and is needed for the performance improvement.
     10
     11        No new tests, covered by existing tests.
     12
     13        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     14        (WebCore::fontFamiliesForPrewarming):
     15        (WebCore::FontCache::prewarmGlobally):
     16
    1172019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r247566 r247626  
    16501650}
    16511651
    1652 void FontCache::prewarmGlobally()
    1653 {
    1654     if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
    1655         return;
    1656 
    1657     Vector<String> families = std::initializer_list<String> {
     1652static Vector<String>& fontFamiliesForPrewarming()
     1653{
     1654    static NeverDestroyed<Vector<String>> families = std::initializer_list<String> {
    16581655        "Arial"_s,
    16591656        "Helvetica"_s,
     
    16631660        "Times New Roman"_s,
    16641661    };
     1662    return families;
     1663}
     1664
     1665void FontCache::prewarmGlobally()
     1666{
     1667    if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
     1668        return;
    16651669
    16661670    FontCache::PrewarmInformation prewarmInfo;
    1667     prewarmInfo.seenFamilies = WTFMove(families);
     1671    prewarmInfo.seenFamilies = fontFamiliesForPrewarming();
     1672    prewarmInfo.fontNamesRequiringSystemFallback = fontFamiliesForPrewarming();
    16681673    FontCache::singleton().prewarm(prewarmInfo);
    16691674}
Note: See TracChangeset for help on using the changeset viewer.