Changeset 239306 in webkit
- Timestamp:
- Dec 17, 2018 5:45:47 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r239288 r239306 1 2018-12-17 Simon Fraser <simon.fraser@apple.com> 2 3 Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled 4 https://bugs.webkit.org/show_bug.cgi?id=192780 5 rdar://problem/43394387 6 7 Reviewed by Tim Horton. 8 9 New macOS Mojave and later results. 10 11 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Added. 12 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style-expected.txt: Added. 13 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-configs-expected.txt: Added. 14 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-enabled-expected.txt: Added. 15 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-images-expected.txt: Added. 16 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-traversal-expected.txt: Added. 17 * platform/mac-mojave/compositing/contents-format/subpixel-antialiased-text-visibility-expected.txt: Added. 18 1 19 2018-12-17 Justin Fan <justin_fan@apple.com> 2 20 -
trunk/Source/WTF/wtf/Platform.h
r239134 r239306 1416 1416 #endif 1417 1417 1418 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 1419 #define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1 1420 #endif 1421 1418 1422 #ifdef __APPLE__ 1419 1423 #define HAVE_FUNC_USLEEP 1 -
trunk/Source/WebCore/ChangeLog
r239289 r239306 1 2018-12-17 Simon Fraser <simon.fraser@apple.com> 2 3 Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled 4 https://bugs.webkit.org/show_bug.cgi?id=192780 5 rdar://problem/43394387 6 7 Reviewed by Tim Horton. 8 9 macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the 10 memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them. 11 12 Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available, 13 and consult it when making decisions that affect layer backing store format. 14 15 Tested by new results for existing tests. 16 17 * platform/graphics/FontCascade.cpp: 18 (WebCore::FontCascade::isSubpixelAntialiasingAvailable): 19 * platform/graphics/FontCascade.h: 20 * platform/graphics/cocoa/FontCascadeCocoa.mm: 21 (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch 22 it once. 23 * rendering/RenderLayerBacking.cpp: 24 (WebCore::RenderLayerBacking::updateAfterDescendants): 25 * testing/Internals.cpp: 26 (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore:: 27 1 28 2018-12-17 Daniel Bates <dabates@apple.com> 2 29 -
trunk/Source/WebCore/PAL/ChangeLog
r239277 r239306 1 2018-12-17 Simon Fraser <simon.fraser@apple.com> 2 3 Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled 4 https://bugs.webkit.org/show_bug.cgi?id=192780 5 rdar://problem/43394387 6 7 Reviewed by Tim Horton. 8 9 Add CGFontRenderingGetFontSmoothingDisabled(). 10 11 * pal/spi/cg/CoreGraphicsSPI.h: 12 1 13 2018-12-17 Daniel Bates <dabates@apple.com> 2 14 -
trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
r238265 r239306 256 256 CGColorSpaceRef CGIOSurfaceContextGetColorSpace(CGContextRef); 257 257 void CGIOSurfaceContextSetDisplayMask(CGContextRef, uint32_t mask); 258 #endif 258 #endif // HAVE(IOSURFACE) 259 259 260 260 #if PLATFORM(COCOA) … … 286 286 void CGPathAddUnevenCornersRoundedRect(CGMutablePathRef, const CGAffineTransform *, CGRect, const CGSize corners[4]); 287 287 #endif 288 #endif 288 289 #if HAVE(CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED) 290 bool CGFontRenderingGetFontSmoothingDisabled(void); 291 #endif 292 293 #endif // PLATFORM(COCOA) 289 294 290 295 #if PLATFORM(WIN) … … 297 302 void CGContextSetShouldUsePlatformNativeGlyphs(CGContextRef, bool); 298 303 void CGContextSetFocusRingWithColor(CGContextRef, CGFloat blur, CGColorRef, const CGRect *clipRect, CFDictionaryRef options); 299 #endif 304 #endif // PLATFORM(WIN) 300 305 301 306 #if PLATFORM(MAC) … … 322 327 #endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) 323 328 324 #endif 329 #endif // PLATFORM(MAC) 325 330 326 331 WTF_EXTERN_C_END -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r238413 r239306 595 595 return shouldUseFontSmoothing; 596 596 } 597 598 #if !PLATFORM(COCOA) 599 bool FontCascade::isSubpixelAntialiasingAvailable() 600 { 601 return false; 602 } 603 #endif 597 604 598 605 void FontCascade::setCodePath(CodePath p) -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r238253 r239306 182 182 WEBCORE_EXPORT static bool shouldUseSmoothing(); 183 183 184 static bool isSubpixelAntialiasingAvailable(); 185 184 186 enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow }; 185 187 CodePath codePath(const TextRun&, std::optional<unsigned> from = std::nullopt, std::optional<unsigned> to = std::nullopt) const; -
trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
r237845 r239306 59 59 namespace WebCore { 60 60 61 // Confusingly, even when CGFontRenderingGetFontSmoothingDisabled() returns true, CGContextSetShouldSmoothFonts() still impacts text 62 // rendering, which is why this function uses the "subpixel antialiasing" rather than "smoothing" terminology. 63 bool FontCascade::isSubpixelAntialiasingAvailable() 64 { 65 #if HAVE(CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED) 66 static bool subpixelAntialiasingEnabled; 67 static std::once_flag onceFlag; 68 std::call_once(onceFlag, [&] () { 69 subpixelAntialiasingEnabled = !CGFontRenderingGetFontSmoothingDisabled(); 70 }); 71 return subpixelAntialiasingEnabled; 72 #elif PLATFORM(MAC) 73 return true; 74 #else 75 return false; 76 #endif 77 } 78 61 79 bool FontCascade::canReturnFallbackFontsForComplexText() 62 80 { -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r238727 r239306 1260 1260 // FIXME: this potentially duplicates work we did in updateConfiguration(). 1261 1261 PaintedContentsInfo contentsInfo(*this); 1262 contentsInfo.setWantsSubpixelAntialiasedTextState(GraphicsLayer::supportsSubpixelAntialiasedLayerText() );1262 contentsInfo.setWantsSubpixelAntialiasedTextState(GraphicsLayer::supportsSubpixelAntialiasedLayerText() && FontCascade::isSubpixelAntialiasingAvailable()); 1263 1263 1264 1264 if (!m_owningLayer.isRenderViewLayer()) { -
trunk/Source/WebCore/testing/Internals.cpp
r239279 r239306 1630 1630 void Internals::setFontSmoothingEnabled(bool enabled) 1631 1631 { 1632 WebCore::FontCascade::setShouldUseSmoothing(enabled);1632 FontCascade::setShouldUseSmoothing(enabled); 1633 1633 } 1634 1634 -
trunk/Tools/ChangeLog
r239303 r239306 1 2018-12-17 Simon Fraser <simon.fraser@apple.com> 2 3 Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled 4 https://bugs.webkit.org/show_bug.cgi?id=192780 5 rdar://problem/43394387 6 7 Reviewed by Tim Horton. 8 9 No need to set "AppleFontSmoothing" defaults for WK2. 10 11 * WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm: 12 (WTR::InjectedBundle::platformInitialize): 13 1 14 2018-12-17 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm
r230190 r239306 37 37 void InjectedBundle::platformInitialize(WKTypeRef initializationUserData) 38 38 { 39 static const int NoFontSmoothing = 0;40 39 static const int BlueTintedAppearance = 1; 41 40 … … 51 50 NSDictionary *dict = @{ 52 51 @"AppleAntiAliasingThreshold": @4, 53 // FIXME: Setting AppleFontSmoothing is likely unnecessary and ineffective. WebKit2 has its own preference for font smoothing, which is54 // applied to each context via CGContextSetShouldSmoothFonts, presumably overriding the default.55 @"AppleFontSmoothing": @(NoFontSmoothing),56 52 @"AppleAquaColorVariant": @(BlueTintedAppearance), 57 53 @"AppleHighlightColor": @"0.709800 0.835300 1.000000",
Note: See TracChangeset
for help on using the changeset viewer.