Changeset 255988 in webkit
- Timestamp:
- Feb 6, 2020 3:31:17 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r255986 r255988 1 2020-02-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r254534): 1-3% regression on PLT 4 https://bugs.webkit.org/show_bug.cgi?id=207244 5 <rdar://problem/58821709> 6 7 Reviewed by Simon Fraser. 8 9 Mark the tests as failing on certain OSes. 10 11 * platform/ios/TestExpectations: 12 * platform/mac/TestExpectations: 13 1 14 2020-02-06 Devin Rousso <drousso@apple.com> 2 15 -
trunk/LayoutTests/platform/ios/TestExpectations
r255960 r255988 3482 3482 3483 3483 webkit.org/b/207278 imported/w3c/web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html [ Pass Failure ] 3484 3485 # Locale-specific shaping is only enabled on certain OSes. 3486 webkit.org/b/77568 fast/text/locale-shaping.html [ ImageOnlyFailure ] 3487 webkit.org/b/77568 fast/text/locale-shaping-complex.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/mac/TestExpectations
r255978 r255988 1932 1932 1933 1933 # Locale-specific shaping is only enabled on certain OSes. 1934 webkit.org/b/77568 [ Sierra HighSierra Mojave ] fast/text/locale-shaping.html [ ImageOnlyFailure ]1935 webkit.org/b/77568 [ Sierra HighSierra Mojave ] fast/text/locale-shaping-complex.html [ ImageOnlyFailure ]1934 webkit.org/b/77568 [ Sierra HighSierra Mojave Catalina ] fast/text/locale-shaping.html [ ImageOnlyFailure ] 1935 webkit.org/b/77568 [ Sierra HighSierra Mojave Catalina ] fast/text/locale-shaping-complex.html [ ImageOnlyFailure ] 1936 1936 1937 1937 webkit.org/b/203222 svg/wicd/rightsizing-grid.xhtml [ Pass Failure ] -
trunk/Source/WTF/ChangeLog
r255973 r255988 1 2020-02-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r254534): 1-3% regression on PLT 4 https://bugs.webkit.org/show_bug.cgi?id=207244 5 <rdar://problem/58821709> 6 7 Reviewed by Simon Fraser. 8 9 CTFontTransformGlyphsWithLanguage() is only acceptable on certain OSes. 10 11 * wtf/PlatformHave.h: 12 1 13 2020-02-06 Commit Queue <commit-queue@webkit.org> 2 14 -
trunk/Source/WTF/wtf/PlatformHave.h
r255973 r255988 463 463 #endif 464 464 465 #if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)466 #define HAVE_CTFONTTRANSFORMGLYPHSWITHLANGUAGE 1467 #endif468 469 465 #if PLATFORM(IOS) || PLATFORM(MACCATALYST) 470 466 #define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1 -
trunk/Source/WTF/wtf/PlatformUse.h
r255216 r255988 312 312 #define USE_DARWIN_REGISTER_MACROS 1 313 313 #endif 314 315 #if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101600) 316 #define USE_CTFONTTRANSFORMGLYPHSWITHLANGUAGE 1 317 #endif -
trunk/Source/WebCore/ChangeLog
r255986 r255988 1 2020-02-06 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r254534): 1-3% regression on PLT 4 https://bugs.webkit.org/show_bug.cgi?id=207244 5 <rdar://problem/58821709> 6 7 Reviewed by Simon Fraser. 8 9 Turns out CTFontTransformGlyphsWithLanguage() is 33.7% slower than CTFontTransformGlyphs() on some OSes. 10 This patch changes the preprocessor guards to not use the function on those OSes. 11 Also, the contract of the function on the more performant OSes requires that the locale name be canonicalized, 12 so this patch implements a canonical locale cache inside LocaleMac.mm. It gets cleared when the low memory 13 warning is fired. 14 15 Marked existing tests as failing. 16 17 * page/cocoa/MemoryReleaseCocoa.mm: 18 (WebCore::platformReleaseMemory): 19 * platform/graphics/cocoa/FontCocoa.mm: 20 (WebCore::Font::applyTransforms const): 21 * platform/graphics/mac/SimpleFontDataCoreText.cpp: 22 (WebCore::Font::getCFStringAttributes const): 23 * platform/text/mac/LocaleMac.h: 24 * platform/text/mac/LocaleMac.mm: 25 (WebCore::determineLocale): 26 (WebCore::canonicalLocaleMap): 27 (WebCore::LocaleMac::canonicalLanguageIdentifierFromString): 28 (WebCore::LocaleMac::releaseMemory): 29 1 30 2020-02-06 Devin Rousso <drousso@apple.com> 2 31 -
trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
r247465 r255988 31 31 #import "IOSurfacePool.h" 32 32 #import "LayerPool.h" 33 #import "LocaleMac.h" 33 34 #import "SystemFontDatabaseCoreText.h" 34 35 #import <notify.h> … … 55 56 GSFontPurgeFontCache(); 56 57 #endif 58 59 LocaleMac::releaseMemory(); 57 60 58 61 for (auto& pool : LayerPool::allLayerPools()) -
trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
r254534 r255988 33 33 #import "FontCascade.h" 34 34 #import "FontDescription.h" 35 #import "LocaleMac.h" 35 36 #import "OpenTypeCG.h" 36 37 #import "SharedBuffer.h" … … 548 549 // FIXME: Implement GlyphBuffer initial advance. 549 550 CTFontTransformOptions options = (enableKerning ? kCTFontTransformApplyPositioning : 0) | (requiresShaping ? kCTFontTransformApplyShaping : 0); 550 #if HAVE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE)551 #if USE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE) 551 552 auto handler = ^(CFRange range, CGGlyph** newGlyphsPointer, CGSize** newAdvancesPointer) { 552 553 range.location = std::min(std::max(range.location, static_cast<CFIndex>(0)), static_cast<CFIndex>(glyphBuffer.size())); … … 560 561 *newAdvancesPointer = glyphBuffer.advances(beginningIndex); 561 562 }; 562 CTFontTransformGlyphsWithLanguage(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options, locale.string().createCFString().get(), handler);563 CTFontTransformGlyphsWithLanguage(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options, LocaleMac::canonicalLanguageIdentifierFromString(locale).string().createCFString().get(), handler); 563 564 #else 564 565 UNUSED_PARAM(locale); -
trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
r254534 r255988 38 38 39 39 CFDictionarySetValue(attributesDictionary.get(), kCTFontAttributeName, platformData().ctFont()); 40 #if HAVE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE)40 #if USE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE) 41 41 if (!locale.isEmpty()) 42 42 CFDictionarySetValue(attributesDictionary.get(), kCTLanguageAttributeName, locale.string().createCFString().get()); -
trunk/Source/WebCore/platform/text/mac/LocaleMac.h
r244664 r255988 68 68 #endif 69 69 70 static AtomString canonicalLanguageIdentifierFromString(const AtomString&); 71 static void releaseMemory(); 72 70 73 private: 71 74 RetainPtr<NSDateFormatter> shortDateFormatter(); -
trunk/Source/WebCore/platform/text/mac/LocaleMac.mm
r248846 r255988 36 36 #import <Foundation/NSLocale.h> 37 37 #import <wtf/DateMath.h> 38 #import <wtf/HashMap.h> 38 39 #import <wtf/Language.h> 39 40 #import <wtf/RetainPtr.h> 41 #import <wtf/text/AtomStringHash.h> 40 42 41 43 #if PLATFORM(IOS_FAMILY) … … 63 65 return currentLocale; 64 66 // It seems initWithLocaleIdentifier accepts dash-separated locale identifier. 65 67 return adoptNS([[NSLocale alloc] initWithLocaleIdentifier:locale]); 66 68 } 67 69 … … 277 279 #endif 278 280 281 using CanonicalLocaleMap = HashMap<AtomString, AtomString>; 282 283 static CanonicalLocaleMap& canonicalLocaleMap() 284 { 285 static NeverDestroyed<CanonicalLocaleMap> canonicalLocaleMap; 286 return canonicalLocaleMap.get(); 287 } 288 289 AtomString LocaleMac::canonicalLanguageIdentifierFromString(const AtomString& string) 290 { 291 return canonicalLocaleMap().ensure(string, [&] { 292 return [NSLocale canonicalLanguageIdentifierFromString:string]; 293 }).iterator->value; 294 } 295 296 void LocaleMac::releaseMemory() 297 { 298 canonicalLocaleMap().clear(); 299 } 300 279 301 void LocaleMac::initializeLocaleData() 280 302 {
Note: See TracChangeset
for help on using the changeset viewer.