Title: [247626] trunk/Source/WebCore
- Revision
- 247626
- Author
- pvol...@apple.com
- Date
- 2019-07-18 17:07:52 -0700 (Thu, 18 Jul 2019)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (247625 => 247626)
--- trunk/Source/WebCore/ChangeLog 2019-07-18 23:46:09 UTC (rev 247625)
+++ trunk/Source/WebCore/ChangeLog 2019-07-19 00:07:52 UTC (rev 247626)
@@ -1,3 +1,19 @@
+2019-07-18 Per Arne Vollan <pvol...@apple.com>
+
+ 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):
+
2019-07-18 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r247531.
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (247625 => 247626)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-07-18 23:46:09 UTC (rev 247625)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-07-19 00:07:52 UTC (rev 247626)
@@ -1649,12 +1649,9 @@
});
}
-void FontCache::prewarmGlobally()
+static Vector<String>& fontFamiliesForPrewarming()
{
- if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
- return;
-
- Vector<String> families = std::initializer_list<String> {
+ static NeverDestroyed<Vector<String>> families = std::initializer_list<String> {
"Arial"_s,
"Helvetica"_s,
"Helvetica Neue"_s,
@@ -1662,9 +1659,17 @@
"Times"_s,
"Times New Roman"_s,
};
+ return families;
+}
+void FontCache::prewarmGlobally()
+{
+ if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
+ return;
+
FontCache::PrewarmInformation prewarmInfo;
- prewarmInfo.seenFamilies = WTFMove(families);
+ prewarmInfo.seenFamilies = fontFamiliesForPrewarming();
+ prewarmInfo.fontNamesRequiringSystemFallback = fontFamiliesForPrewarming();
FontCache::singleton().prewarm(prewarmInfo);
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes