Source/WTF/ChangeLog

 12020-08-19 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Cocoa] CTFontIsSystemUIFont() is faster than CTFontDescriptorIsSystemUIFont()/CTFontCopyFontDescriptor()
 4 https://bugs.webkit.org/show_bug.cgi?id=215687
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * wtf/PlatformUse.h:
 9
1102020-08-18 Simon Fraser <simon.fraser@apple.com>
211
312 Turn off wheel event regions until we need them

Source/WebCore/ChangeLog

 12020-08-19 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Cocoa] CTFontIsSystemUIFont() is faster than CTFontDescriptorIsSystemUIFont()/CTFontCopyFontDescriptor()
 4 https://bugs.webkit.org/show_bug.cgi?id=215687
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Instead of making the two calls, we can make a single call that has the same effect.
 9
 10 No new tests because there is no behavior change.
 11
 12 * platform/graphics/FontPlatformData.h:
 13 * platform/graphics/cocoa/FontCacheCoreText.cpp:
 14 (WebCore::fontIsSystemFont):
 15 * platform/graphics/cocoa/FontCascadeCocoa.mm:
 16 (WebCore::FontCascade::primaryFontIsSystemFont const):
 17 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
 18 (WebCore::FontPlatformData::FontPlatformData):
 19 (WebCore::FontPlatformData::isSystemFont):
 20
1212020-08-18 Chris Dumez <cdumez@apple.com>
222
323 AudioBuffer.duration should use double precision

Source/WebCore/PAL/ChangeLog

 12020-08-19 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Cocoa] CTFontIsSystemUIFont() is faster than CTFontDescriptorIsSystemUIFont()/CTFontCopyFontDescriptor()
 4 https://bugs.webkit.org/show_bug.cgi?id=215687
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * pal/spi/cocoa/CoreTextSPI.h:
 9
1102020-08-11 Myles C. Maxfield <mmaxfield@apple.com>
211
312 Fix Apple internal Mojave builds

Source/WTF/wtf/PlatformUse.h

304304#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110000)
305305#define USE_CTFONTSHAPEGLYPHS 1
306306#endif
 307
 308#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110000)
 309#define USE_CTFONTISSYSTEMUIFONT 1
 310#endif

Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h

@@extern const CFStringRef kCTFontUIFontDesignRounded;
137137extern const CFStringRef kCTFrameMaximumNumberOfLinesAttributeName;
138138
139139bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
 140bool CTFontIsSystemUIFont(CTFontRef);
140141CTFontRef CTFontCreateForCSS(CFStringRef name, uint16_t weight, CTFontSymbolicTraits, CGFloat size);
141142CTFontRef CTFontCreateForCharactersWithLanguage(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFStringRef language, CFIndex *coveredLength);
142143CTFontRef CTFontCreateForCharactersWithLanguageAndOption(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFStringRef language, CTFontFallbackOption option, CFIndex *coveredLength);

Source/WebCore/platform/graphics/FontPlatformData.h

@@public:
128128 RetainPtr<CFTypeRef> objectForEqualityCheck() const;
129129
130130 bool hasCustomTracking() const { return isSystemFont(); }
 131
 132 static bool isSystemFont(CTFontRef);
131133#endif
132134
133135#if PLATFORM(WIN) || PLATFORM(COCOA)

Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

@@static VariationDefaultsMap defaultVariationValues(CTFontRef font)
425425
426426static inline bool fontIsSystemFont(CTFontRef font)
427427{
428  if (CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(font)).get()))
 428 if (FontPlatformData::isSystemFont(font))
429429 return true;
430430
431431 auto name = adoptCF(CTFontCopyPostScriptName(font));

Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm

@@void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
316316bool FontCascade::primaryFontIsSystemFont() const
317317{
318318 const auto& fontData = primaryFont();
319  return CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(fontData.platformData().ctFont())).get());
 319 return FontPlatformData::isSystemFont(fontData.platformData().ctFont());
320320}
321321
322322// FIXME: Use this on all ports.

Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

@@FontPlatformData::FontPlatformData(CTFontRef font, float size, bool syntheticBol
4444 ASSERT_ARG(font, font);
4545 m_font = font;
4646 m_isColorBitmapFont = CTFontGetSymbolicTraits(font) & kCTFontTraitColorGlyphs;
47  m_isSystemFont = CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(m_font.get())).get());
 47 m_isSystemFont = FontPlatformData::isSystemFont(m_font.get());
4848 auto variations = adoptCF(static_cast<CFDictionaryRef>(CTFontCopyAttribute(font, kCTFontVariationAttribute)));
4949 m_hasVariations = variations && CFDictionaryGetCount(variations.get());
5050

@@RetainPtr<CFTypeRef> FontPlatformData::objectForEqualityCheck() const
160160 return objectForEqualityCheck(ctFont());
161161}
162162
 163bool FontPlatformData::isSystemFont(CTFontRef font)
 164{
 165#if USE(CTFONTISSYSTEMUIFONT)
 166 return CTFontIsSystemUIFont(font);
 167#else
 168 return CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(font)).get());
 169#endif
 170}
 171
163172RefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
164173{
165174 if (RetainPtr<CFDataRef> data = adoptCF(CTFontCopyTable(font(), table, kCTFontTableOptionNoOptions)))