Changeset 212776 in webkit
- Timestamp:
- Feb 21, 2017 4:30:32 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r212773 r212776 1 2017-02-20 Simon Fraser <simon.fraser@apple.com> 2 3 Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch 4 https://bugs.webkit.org/show_bug.cgi?id=168620 5 <rdar://problem/30617772> 6 7 Reviewed by Tim Horton. 8 9 Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and 10 PlatformCALayer, where it ultimately affects the layer contents format. 11 12 TileControllers are slightly special because we communicate with them via an Obj-C 13 WebTiledBackingLayer. 14 15 Test: compositing/contents-format/subpixel-antialiased-text-enabled.html 16 17 * page/Settings.in: 18 * platform/graphics/GraphicsLayer.cpp: 19 (WebCore::GraphicsLayer::GraphicsLayer): 20 (WebCore::GraphicsLayer::dumpProperties): 21 * platform/graphics/GraphicsLayer.h: 22 (WebCore::GraphicsLayer::supportsSubpixelAntialiasedText): 23 (WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText): 24 * platform/graphics/ca/GraphicsLayerCA.cpp: 25 (WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText): 26 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 27 (WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText): 28 * platform/graphics/ca/GraphicsLayerCA.h: 29 * platform/graphics/ca/PlatformCALayer.cpp: 30 (WebCore::PlatformCALayer::drawRepaintIndicator): 31 * platform/graphics/ca/PlatformCALayer.h: 32 * platform/graphics/ca/TileController.cpp: 33 (WebCore::TileController::setWantsDeepColorBackingStore): 34 (WebCore::TileController::setSupportsSubpixelAntialiasedText): 35 (WebCore::TileController::setTilesOpaque): 36 * platform/graphics/ca/TileController.h: 37 * platform/graphics/ca/TileGrid.cpp: 38 (WebCore::TileGrid::updateTileLayerProperties): 39 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: 40 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: 41 (PlatformCALayerCocoa::supportsSubpixelAntialiasedText): 42 (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText): 43 (layerContentsFormat): 44 (PlatformCALayerCocoa::updateContentsFormat): 45 (PlatformCALayer::drawLayerContents): 46 * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: 47 * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: 48 (-[WebTiledBackingLayer drawsAsynchronously]): 49 (-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]): 50 (-[WebTiledBackingLayer supportsSubpixelAntialiasedText]): 51 * platform/spi/cocoa/QuartzCoreSPI.h: 52 * rendering/RenderLayerBacking.cpp: 53 (WebCore::RenderLayerBacking::createGraphicsLayer): 54 1 55 2017-02-21 Chris Dumez <cdumez@apple.com> 2 56 -
trunk/Source/WebCore/page/Settings.in
r212633 r212776 202 202 minimumZoomFontSize type=float, initial=defaultMinimumZoomFontSize(), conditional=TEXT_AUTOSIZING 203 203 204 subpixelAntialiasedLayerTextEnabled initial=false, setNeedsStyleRecalcInAllFrames=1 204 205 simpleLineLayoutEnabled initial=true, setNeedsStyleRecalcInAllFrames=1 205 206 simpleLineLayoutDebugBordersEnabled initial=false, setNeedsStyleRecalcInAllFrames=1 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r212153 r212776 116 116 , m_type(type) 117 117 , m_contentsOpaque(false) 118 , m_supportsSubpixelAntialiasedText(false) 118 119 , m_preserves3D(false) 119 120 , m_backfaceVisibility(true) … … 763 764 } 764 765 766 if (m_supportsSubpixelAntialiasedText) { 767 writeIndent(ts, indent + 1); 768 ts << "(supports subpixel antialiased text " << m_supportsSubpixelAntialiasedText << ")\n"; 769 } 770 765 771 if (m_preserves3D) { 766 772 writeIndent(ts, indent + 1); -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r212153 r212776 375 375 virtual void setContentsOpaque(bool b) { m_contentsOpaque = b; } 376 376 377 bool supportsSubpixelAntialiasedText() const { return m_supportsSubpixelAntialiasedText; } 378 virtual void setSupportsSubpixelAntialiasedText(bool b) { m_supportsSubpixelAntialiasedText = b; } 379 377 380 bool backfaceVisibility() const { return m_backfaceVisibility; } 378 381 virtual void setBackfaceVisibility(bool b) { m_backfaceVisibility = b; } … … 632 635 633 636 bool m_contentsOpaque : 1; 637 bool m_supportsSubpixelAntialiasedText : 1; 634 638 bool m_preserves3D: 1; 635 639 bool m_backfaceVisibility : 1; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r212590 r212776 739 739 } 740 740 741 void GraphicsLayerCA::setSupportsSubpixelAntialiasedText(bool supportsSubpixelAntialiasedText) 742 { 743 if (m_supportsSubpixelAntialiasedText == supportsSubpixelAntialiasedText) 744 return; 745 746 GraphicsLayer::setSupportsSubpixelAntialiasedText(supportsSubpixelAntialiasedText); 747 noteLayerPropertyChanged(SupportsSubpixelAntialiasedTextChanged); 748 } 749 741 750 void GraphicsLayerCA::setBackfaceVisibility(bool visible) 742 751 { … … 1672 1681 updateAcceleratesDrawing(); 1673 1682 1683 if (m_uncommittedChanges & SupportsSubpixelAntialiasedTextChanged) 1684 updateSupportsSubpixelAntialiasedText(); 1685 1674 1686 if (m_uncommittedChanges & DebugIndicatorsChanged) 1675 1687 updateDebugBorder(); … … 2201 2213 { 2202 2214 m_layer->setAcceleratesDrawing(m_acceleratesDrawing); 2215 } 2216 2217 void GraphicsLayerCA::updateSupportsSubpixelAntialiasedText() 2218 { 2219 m_layer->setSupportsSubpixelAntialiasedText(m_supportsSubpixelAntialiasedText); 2203 2220 } 2204 2221 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r212730 r212776 95 95 96 96 WEBCORE_EXPORT void setContentsOpaque(bool) override; 97 WEBCORE_EXPORT void setSupportsSubpixelAntialiasedText(bool) override; 98 97 99 WEBCORE_EXPORT void setBackfaceVisibility(bool) override; 98 100 … … 406 408 void updateContentsNeedsDisplay(); 407 409 void updateAcceleratesDrawing(); 410 void updateSupportsSubpixelAntialiasedText(); 408 411 void updateDebugBorder(); 409 412 void updateTiles(); … … 453 456 454 457 enum LayerChange : uint64_t { 455 NoChange = 0, 456 NameChanged = 1LLU << 1, 457 ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes? 458 GeometryChanged = 1LLU << 3, 459 TransformChanged = 1LLU << 4, 460 ChildrenTransformChanged = 1LLU << 5, 461 Preserves3DChanged = 1LLU << 6, 462 MasksToBoundsChanged = 1LLU << 7, 463 DrawsContentChanged = 1LLU << 8, 464 BackgroundColorChanged = 1LLU << 9, 465 ContentsOpaqueChanged = 1LLU << 10, 466 BackfaceVisibilityChanged = 1LLU << 11, 467 OpacityChanged = 1LLU << 12, 468 AnimationChanged = 1LLU << 13, 469 DirtyRectsChanged = 1LLU << 14, 470 ContentsImageChanged = 1LLU << 15, 471 ContentsPlatformLayerChanged = 1LLU << 16, 472 ContentsColorLayerChanged = 1LLU << 17, 473 ContentsRectsChanged = 1LLU << 18, 474 MasksToBoundsRectChanged = 1LLU << 19, 475 MaskLayerChanged = 1LLU << 20, 476 ReplicatedLayerChanged = 1LLU << 21, 477 ContentsNeedsDisplay = 1LLU << 22, 478 AcceleratesDrawingChanged = 1LLU << 23, 479 ContentsScaleChanged = 1LLU << 24, 480 ContentsVisibilityChanged = 1LLU << 25, 481 CoverageRectChanged = 1LLU << 26, 482 FiltersChanged = 1LLU << 27, 483 BackdropFiltersChanged = 1LLU << 28, 484 BackdropFiltersRectChanged = 1LLU << 29, 485 TilingAreaChanged = 1LLU << 30, 486 TilesAdded = 1LLU << 31, 487 DebugIndicatorsChanged = 1LLU << 32, 488 CustomAppearanceChanged = 1LLU << 33, 489 BlendModeChanged = 1LLU << 34, 490 ShapeChanged = 1LLU << 35, 491 WindRuleChanged = 1LLU << 36, 492 UserInteractionEnabledChanged = 1LLU << 37, 458 NoChange = 0, 459 NameChanged = 1LLU << 1, 460 ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes? 461 GeometryChanged = 1LLU << 3, 462 TransformChanged = 1LLU << 4, 463 ChildrenTransformChanged = 1LLU << 5, 464 Preserves3DChanged = 1LLU << 6, 465 MasksToBoundsChanged = 1LLU << 7, 466 DrawsContentChanged = 1LLU << 8, 467 BackgroundColorChanged = 1LLU << 9, 468 ContentsOpaqueChanged = 1LLU << 10, 469 BackfaceVisibilityChanged = 1LLU << 11, 470 OpacityChanged = 1LLU << 12, 471 AnimationChanged = 1LLU << 13, 472 DirtyRectsChanged = 1LLU << 14, 473 ContentsImageChanged = 1LLU << 15, 474 ContentsPlatformLayerChanged = 1LLU << 16, 475 ContentsColorLayerChanged = 1LLU << 17, 476 ContentsRectsChanged = 1LLU << 18, 477 MasksToBoundsRectChanged = 1LLU << 19, 478 MaskLayerChanged = 1LLU << 20, 479 ReplicatedLayerChanged = 1LLU << 21, 480 ContentsNeedsDisplay = 1LLU << 22, 481 AcceleratesDrawingChanged = 1LLU << 23, 482 SupportsSubpixelAntialiasedTextChanged = 1LLU << 24, 483 ContentsScaleChanged = 1LLU << 25, 484 ContentsVisibilityChanged = 1LLU << 26, 485 CoverageRectChanged = 1LLU << 27, 486 FiltersChanged = 1LLU << 28, 487 BackdropFiltersChanged = 1LLU << 29, 488 BackdropFiltersRectChanged = 1LLU << 30, 489 TilingAreaChanged = 1LLU << 31, 490 TilesAdded = 1LLU << 32, 491 DebugIndicatorsChanged = 1LLU << 33, 492 CustomAppearanceChanged = 1LLU << 34, 493 BlendModeChanged = 1LLU << 35, 494 ShapeChanged = 1LLU << 36, 495 WindRuleChanged = 1LLU << 37, 496 UserInteractionEnabledChanged = 1LLU << 38, 493 497 }; 494 498 typedef uint64_t LayerChangeFlags; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
r212590 r212776 117 117 } 118 118 119 if (!platformCALayer->isOpaque() && platformCALayer->supportsSubpixelAntialiasedText()) { 120 // Draw a gray shadow behind the repaint count. 121 CGContextSetRGBFillColor(context, 1, 1, 1, 0.4); 122 platformCALayer->drawTextAtPoint(context, indicatorBox.x() + 7, indicatorBox.y() + 24, CGSizeMake(1, -1), 22, text, strlen(text)); 123 } 124 119 125 if (platformCALayer->acceleratesDrawing()) 120 126 CGContextSetRGBFillColor(context, 1, 0, 0, 1); -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r212590 r212776 180 180 virtual void setWantsDeepColorBackingStore(bool) = 0; 181 181 182 virtual bool supportsSubpixelAntialiasedText() const = 0; 183 virtual void setSupportsSubpixelAntialiasedText(bool) = 0; 184 182 185 virtual CFTypeRef contents() const = 0; 183 186 virtual void setContents(CFTypeRef) = 0; -
trunk/Source/WebCore/platform/graphics/ca/TileController.cpp
r212590 r212776 180 180 181 181 m_wantsDeepColorBackingStore = wantsDeepColorBackingStore; 182 183 182 tileGrid().updateTileLayerProperties(); 184 183 } 185 184 185 void TileController::setSupportsSubpixelAntialiasedText(bool supportsSubpixelAntialiasedText) 186 { 187 if (m_supportsSubpixelAntialiasedText == supportsSubpixelAntialiasedText) 188 return; 189 190 m_supportsSubpixelAntialiasedText = supportsSubpixelAntialiasedText; 191 tileGrid().updateTileLayerProperties(); 192 } 193 186 194 void TileController::setTilesOpaque(bool opaque) 187 195 { 188 196 if (opaque == m_tilesAreOpaque) 189 197 return; 198 190 199 m_tilesAreOpaque = opaque; 191 192 200 tileGrid().updateTileLayerProperties(); 193 201 } -
trunk/Source/WebCore/platform/graphics/ca/TileController.h
r212590 r212776 74 74 bool wantsDeepColorBackingStore() const { return m_wantsDeepColorBackingStore; } 75 75 WEBCORE_EXPORT void setWantsDeepColorBackingStore(bool); 76 77 bool supportsSubpixelAntialiasedText() const { return m_supportsSubpixelAntialiasedText; } 78 WEBCORE_EXPORT void setSupportsSubpixelAntialiasedText(bool); 76 79 77 80 WEBCORE_EXPORT void setTilesOpaque(bool); … … 222 225 bool m_acceleratesDrawing { false }; 223 226 bool m_wantsDeepColorBackingStore { false }; 227 bool m_supportsSubpixelAntialiasedText { false }; 224 228 bool m_tilesAreOpaque { false }; 225 229 bool m_hasTilesWithTemporaryScaleFactor { false }; // Used to make low-res tiles when zooming. -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp
r212590 r212776 200 200 bool acceleratesDrawing = m_controller.acceleratesDrawing(); 201 201 bool deepColor = m_controller.wantsDeepColorBackingStore(); 202 bool subpixelAntialiasedText = m_controller.supportsSubpixelAntialiasedText(); 202 203 bool opaque = m_controller.tilesAreOpaque(); 203 204 Color tileDebugBorderColor = m_controller.tileDebugBorderColor(); … … 208 209 tileInfo.layer->setAcceleratesDrawing(acceleratesDrawing); 209 210 tileInfo.layer->setWantsDeepColorBackingStore(deepColor); 211 tileInfo.layer->setSupportsSubpixelAntialiasedText(subpixelAntialiasedText); 210 212 tileInfo.layer->setOpaque(opaque); 211 213 tileInfo.layer->setBorderColor(tileDebugBorderColor); -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
r212590 r212776 114 114 void setWantsDeepColorBackingStore(bool) override; 115 115 116 bool supportsSubpixelAntialiasedText() const override; 117 void setSupportsSubpixelAntialiasedText(bool) override; 118 116 119 CFTypeRef contents() const override; 117 120 void setContents(CFTypeRef) override; … … 192 195 std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect; 193 196 bool m_wantsDeepColorBackingStore { false }; 197 bool m_supportsSubpixelAntialiasedText { false }; 194 198 }; 195 199 -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
r212590 r212776 706 706 } 707 707 708 bool PlatformCALayerCocoa::supportsSubpixelAntialiasedText() const 709 { 710 return m_supportsSubpixelAntialiasedText; 711 } 712 713 void PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText(bool supportsSubpixelAntialiasedText) 714 { 715 if (supportsSubpixelAntialiasedText == m_supportsSubpixelAntialiasedText) 716 return; 717 718 m_supportsSubpixelAntialiasedText = supportsSubpixelAntialiasedText; 719 720 if (usesTiledBackingLayer()) { 721 [static_cast<WebTiledBackingLayer *>(m_layer.get()) setSupportsSubpixelAntialiasedText:m_supportsSubpixelAntialiasedText]; 722 return; 723 } 724 725 updateContentsFormat(); 726 } 727 708 728 CFTypeRef PlatformCALayerCocoa::contents() const 709 729 { … … 976 996 977 997 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) 978 static NSString *layerContentsFormat(bool wantsDeepColor )998 static NSString *layerContentsFormat(bool wantsDeepColor, bool supportsSubpixelAntialiasedFonts) 979 999 { 980 1000 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300 … … 984 1004 UNUSED_PARAM(wantsDeepColor); 985 1005 #endif 1006 1007 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 1008 if (supportsSubpixelAntialiasedFonts) 1009 return kCAContentsFormatRGBA8ColorRGBA8LinearGlyphMask; 1010 #else 1011 UNUSED_PARAM(supportsSubpixelAntialiasedFonts); 1012 #endif 1013 986 1014 return nil; 987 1015 } … … 993 1021 BEGIN_BLOCK_OBJC_EXCEPTIONS 994 1022 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90300) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) 995 if (NSString *formatString = layerContentsFormat(wantsDeepColorBackingStore() ))1023 if (NSString *formatString = layerContentsFormat(wantsDeepColorBackingStore(), supportsSubpixelAntialiasedText())) 996 1024 [m_layer setContentsFormat:formatString]; 997 1025 #endif … … 1108 1136 graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing()); 1109 1137 1110 if (!layerContents->platformCALayerContentsOpaque() ) {1138 if (!layerContents->platformCALayerContentsOpaque() && !platformCALayer->supportsSubpixelAntialiasedText()) { 1111 1139 // Turn off font smoothing to improve the appearance of text rendered onto a transparent background. 1112 1140 graphicsContext.setShouldSmoothFonts(false); -
trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h
r212590 r212776 47 47 - (BOOL)wantsDeepColorBackingStore; 48 48 49 - (void)setSupportsSubpixelAntialiasedText:(BOOL)supportsSubpixelAntialiasedText; 50 - (BOOL)supportsSubpixelAntialiasedText; 51 49 52 @end 50 53 -
trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.mm
r212590 r212776 109 109 } 110 110 111 - (BOOL)drawsAsynchronously 112 { 113 return _tileController ? _tileController->acceleratesDrawing() : NO; 114 } 115 111 116 - (void)setWantsDeepColorBackingStore:(BOOL)wantsDeepColor 112 117 { … … 119 124 } 120 125 121 - ( BOOL)drawsAsynchronously126 - (void)setSupportsSubpixelAntialiasedText:(BOOL)supportsSubpixelAntialiasedText 122 127 { 123 return _tileController ? _tileController->acceleratesDrawing() : NO; 128 _tileController->setSupportsSubpixelAntialiasedText(supportsSubpixelAntialiasedText); 129 } 130 131 - (BOOL)supportsSubpixelAntialiasedText 132 { 133 return _tileController->supportsSubpixelAntialiasedText(); 124 134 } 125 135 -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r212590 r212776 529 529 } 530 530 531 bool PlatformCALayerWin::supportsSubpixelAntialiasedText() const 532 { 533 return false 534 } 535 536 void PlatformCALayerWin::setSupportsSubpixelAntialiasedText(bool) 537 { 538 } 539 531 540 CFTypeRef PlatformCALayerWin::contents() const 532 541 { -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
r212590 r212776 106 106 void setWantsDeepColorBackingStore(bool) override; 107 107 108 bool supportsSubpixelAntialiasedText() const override; 109 void setSupportsSubpixelAntialiasedText(bool) override; 110 108 111 CFTypeRef contents() const override; 109 112 void setContents(CFTypeRef) override; -
trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
r212590 r212776 222 222 #endif 223 223 224 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 225 extern NSString * const kCAContentsFormatRGBA8ColorRGBA8LinearGlyphMask; 226 #endif 227 224 228 #if (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED < 100000) \ 225 229 || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED < 30000) \ -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r211750 r212776 143 143 graphicsLayer->setAcceleratesDrawing(compositor().acceleratedDrawingEnabled()); 144 144 graphicsLayer->setUsesDisplayListDrawing(compositor().displayListDrawingEnabled()); 145 graphicsLayer->setSupportsSubpixelAntialiasedText(renderer().settings().subpixelAntialiasedLayerTextEnabled()); 145 146 #endif 146 147 -
trunk/Source/WebKit/mac/ChangeLog
r212774 r212776 1 2017-02-20 Simon Fraser <simon.fraser@apple.com> 2 3 Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch 4 https://bugs.webkit.org/show_bug.cgi?id=168620 5 <rdar://problem/30617772> 6 7 Reviewed by Tim Horton. 8 9 * WebView/WebPreferenceKeysPrivate.h: 10 * WebView/WebPreferences.mm: 11 (+[WebPreferences initialize]): 12 (-[WebPreferences subpixelAntialiasedLayerTextEnabled]): 13 (-[WebPreferences setSubpixelAntialiasedLayerTextEnabled:]): 14 * WebView/WebPreferencesPrivate.h: 15 1 16 2017-02-21 Aakash Jain <aakash_jain@apple.com> 2 17 -
trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
r212331 r212776 106 106 #define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled" 107 107 #define WebKitShowDebugBordersPreferenceKey @"WebKitShowDebugBorders" 108 #define WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey @"WebKitSubpixelAntialiasedLayerTextEnabled" 108 109 #define WebKitSimpleLineLayoutEnabledPreferenceKey @"WebKitSimpleLineLayoutEnabled" 109 110 #define WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey @"WebKitSimpleLineLayoutDebugBordersEnabled" -
trunk/Source/WebKit/mac/WebView/WebPreferences.mm
r212629 r212776 492 492 [NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey, 493 493 [NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey, 494 [NSNumber numberWithBool:NO], WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey, 494 495 [NSNumber numberWithBool:NO], WebKitDisplayListDrawingEnabledPreferenceKey, 495 496 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR) … … 1962 1963 } 1963 1964 1965 - (BOOL)subpixelAntialiasedLayerTextEnabled 1966 { 1967 return [self _boolValueForKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey]; 1968 } 1969 1970 - (void)setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled 1971 { 1972 [self _setBoolValue:enabled forKey:WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey]; 1973 } 1974 1964 1975 - (BOOL)simpleLineLayoutEnabled 1965 1976 { -
trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h
r212331 r212776 225 225 - (void)setAcceleratedCompositingEnabled:(BOOL)enabled; 226 226 227 - (BOOL)subpixelAntialiasedLayerTextEnabled; 228 - (void)setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled; 229 227 230 - (BOOL)showDebugBorders; 228 231 - (void)setShowDebugBorders:(BOOL)show; -
trunk/Source/WebKit2/ChangeLog
r212766 r212776 1 2017-02-20 Simon Fraser <simon.fraser@apple.com> 2 3 Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch 4 https://bugs.webkit.org/show_bug.cgi?id=168620 5 <rdar://problem/30617772> 6 7 Reviewed by Tim Horton. 8 9 Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and 10 PlatformCALayer, where it ultimately affects the layer contents format. 11 12 This is not supported with UI-side compositing. 13 14 * Shared/WebPreferencesDefinitions.h: 15 * UIProcess/API/C/WKPreferences.cpp: 16 (WKPreferencesSetSubpixelAntialiasedLayerTextEnabled): 17 (WKPreferencesGetSubpixelAntialiasedLayerTextEnabled): 18 * UIProcess/API/C/WKPreferencesRefPrivate.h: 19 * UIProcess/API/Cocoa/WKPreferences.mm: 20 (-[WKPreferences _subpixelAntialiasedLayerTextEnabled]): 21 (-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]): 22 * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 23 * WebProcess/WebPage/WebPage.cpp: 24 (WebKit::WebPage::updatePreferences): 25 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 26 (WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText): 27 (WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText): 28 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 29 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: 30 (WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText): 31 (WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText): 32 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: 33 1 34 2017-02-21 John Wilander <wilander@apple.com> 2 35 -
trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h
r212704 r212776 274 274 #define FOR_EACH_WEBKIT_DEBUG_BOOL_PREFERENCE(macro) \ 275 275 macro(AcceleratedDrawingEnabled, acceleratedDrawingEnabled, Bool, bool, DEFAULT_ACCELERATED_DRAWING_ENABLED, "", "") \ 276 macro(SubpixelAntialiasedLayerTextEnabled, subpixelAntialiasedLayerTextEnabled, Bool, bool, false, "", "") \ 276 277 macro(DisplayListDrawingEnabled, displayListDrawingEnabled, Bool, bool, false, "", "") \ 277 278 macro(CompositingBordersVisible, compositingBordersVisible, Bool, bool, false, "", "") \ -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
r212173 r212776 384 384 } 385 385 386 void WKPreferencesSetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef preferencesRef, bool flag) 387 { 388 toImpl(preferencesRef)->setSubpixelAntialiasedLayerTextEnabled(flag); 389 } 390 391 bool WKPreferencesGetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef preferencesRef) 392 { 393 return toImpl(preferencesRef)->subpixelAntialiasedLayerTextEnabled(); 394 } 395 386 396 void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef, bool flag) 387 397 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
r212173 r212776 64 64 WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef); 65 65 66 // Defaults to false. 67 WK_EXPORT void WKPreferencesSetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef, bool); 68 WK_EXPORT bool WKPreferencesGetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef); 69 66 70 // Defaults to EditableLinkNeverLive. 67 71 WK_EXPORT void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
r211135 r212776 366 366 } 367 367 368 - (BOOL)_subpixelAntialiasedLayerTextEnabled 369 { 370 return _preferences->subpixelAntialiasedLayerTextEnabled(); 371 } 372 373 - (void)_setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled 374 { 375 _preferences->setSubpixelAntialiasedLayerTextEnabled(enabled); 376 } 377 368 378 - (BOOL)_developerExtrasEnabled 369 379 { -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h
r211135 r212776 68 68 @property (nonatomic, setter=_setAnimatedImageAsyncDecodingEnabled:) BOOL _animatedImageAsyncDecodingEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 69 69 @property (nonatomic, setter=_setTextAutosizingEnabled:) BOOL _textAutosizingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 70 @property (nonatomic, setter=_setSubpixelAntialiasedLayerTextEnabled:) BOOL _subpixelAntialiasedLayerTextEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 70 71 71 72 @property (nonatomic, setter=_setDeveloperExtrasEnabled:) BOOL _developerExtrasEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0)); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r212745 r212776 3006 3006 settings.setVisibleDebugOverlayRegions(store.getUInt32ValueForKey(WebPreferencesKey::visibleDebugOverlayRegionsKey())); 3007 3007 settings.setUseGiantTiles(store.getBoolValueForKey(WebPreferencesKey::useGiantTilesKey())); 3008 3008 settings.setSubpixelAntialiasedLayerTextEnabled(store.getBoolValueForKey(WebPreferencesKey::subpixelAntialiasedLayerTextEnabledKey())); 3009 3009 3010 settings.setAggressiveTileRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::aggressiveTileRetentionEnabledKey())); 3010 3011 settings.setTemporaryTileCohortRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::temporaryTileCohortRetentionEnabledKey())); -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r212590 r212776 608 608 } 609 609 610 bool PlatformCALayerRemote::supportsSubpixelAntialiasedText() const 611 { 612 return false; 613 } 614 615 void PlatformCALayerRemote::setSupportsSubpixelAntialiasedText(bool) 616 { 617 } 618 610 619 CFTypeRef PlatformCALayerRemote::contents() const 611 620 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r212590 r212776 119 119 void setWantsDeepColorBackingStore(bool) override; 120 120 121 bool supportsSubpixelAntialiasedText() const override; 122 void setSupportsSubpixelAntialiasedText(bool) override; 123 121 124 CFTypeRef contents() const override; 122 125 void setContents(CFTypeRef) override; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp
r212590 r212776 98 98 } 99 99 100 bool PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText() const 101 { 102 return m_tileController->supportsSubpixelAntialiasedText(); 103 } 104 105 void PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText(bool supportsSubpixelAntialiasedText) 106 { 107 m_tileController->setSupportsSubpixelAntialiasedText(supportsSubpixelAntialiasedText); 108 } 109 100 110 float PlatformCALayerRemoteTiledBacking::contentsScale() const 101 111 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h
r212590 r212776 57 57 bool wantsDeepColorBackingStore() const override; 58 58 void setWantsDeepColorBackingStore(bool) override; 59 59 60 bool supportsSubpixelAntialiasedText() const override; 61 void setSupportsSubpixelAntialiasedText(bool) override; 62 60 63 float contentsScale() const override; 61 64 void setContentsScale(float) override; -
trunk/Tools/ChangeLog
r212757 r212776 1 2017-02-20 Simon Fraser <simon.fraser@apple.com> 2 3 Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch 4 https://bugs.webkit.org/show_bug.cgi?id=168620 5 <rdar://problem/30617772> 6 7 Reviewed by Tim Horton. 8 9 Add a setting that allows one to toggle subpixel-antialiased layer text on and off. 10 11 * DumpRenderTree/mac/DumpRenderTree.mm: 12 (resetWebPreferencesToConsistentValues): 13 * MiniBrowser/mac/SettingsController.h: 14 * MiniBrowser/mac/SettingsController.m: 15 (-[SettingsController _populateMenu]): 16 (-[SettingsController validateMenuItem:]): 17 (-[SettingsController toggleSubpixelAntialiasedLayerTextEnabled:]): 18 (-[SettingsController subpixelAntialiasedLayerTextEnabled]): 19 * MiniBrowser/mac/WK1BrowserWindowController.m: 20 (-[WK1BrowserWindowController didChangeSettings]): 21 * MiniBrowser/mac/WK2BrowserWindowController.m: 22 (-[WK2BrowserWindowController didChangeSettings]): 23 * WebKitTestRunner/TestController.cpp: 24 (WTR::TestController::resetPreferencesToConsistentValues): 25 1 26 2017-02-21 John Wilander <wilander@apple.com> 2 27 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r212513 r212776 972 972 } else 973 973 [preferences setUserStyleSheetEnabled:NO]; 974 974 975 [preferences setMediaPlaybackAllowsInline:YES]; 975 976 [preferences setVideoPlaybackRequiresUserGesture:NO]; … … 977 978 [preferences setMediaDataLoadsAutomatically:YES]; 978 979 [preferences setInvisibleAutoplayNotPermitted:NO]; 980 [preferences setSubpixelAntialiasedLayerTextEnabled:NO]; 979 981 980 982 #if PLATFORM(IOS) -
trunk/Tools/MiniBrowser/mac/SettingsController.h
r211135 r212776 52 52 @property (nonatomic, readonly) BOOL acceleratedDrawingEnabled; 53 53 @property (nonatomic, readonly) BOOL displayListDrawingEnabled; 54 @property (nonatomic, readonly) BOOL subpixelAntialiasedLayerTextEnabled; 54 55 @property (nonatomic, readonly) BOOL resourceLoadStatisticsEnabled; 55 56 @property (nonatomic, readonly) BOOL visualViewportEnabled; -
trunk/Tools/MiniBrowser/mac/SettingsController.m
r211769 r212776 51 51 static NSString * const AcceleratedDrawingEnabledPreferenceKey = @"AcceleratedDrawingEnabled"; 52 52 static NSString * const DisplayListDrawingEnabledPreferenceKey = @"DisplayListDrawingEnabled"; 53 static NSString * const SubpixelAntialiasedLayerTextEnabledPreferenceKey = @"SubpixelAntialiasedLayerTextEnabled"; 53 54 static NSString * const ResourceLoadStatisticsEnabledPreferenceKey = @"ResourceLoadStatisticsEnabled"; 54 55 … … 135 136 [self _addItemWithTitle:@"Enable Accelerated Drawing" action:@selector(toggleAcceleratedDrawingEnabled:) indented:NO]; 136 137 [self _addItemWithTitle:@"Enable Display List Drawing" action:@selector(toggleDisplayListDrawingEnabled:) indented:NO]; 138 [self _addItemWithTitle:@"Enable Subpixel-antialiased Layer Text" action:@selector(toggleSubpixelAntialiasedLayerTextEnabled:) indented:NO]; 137 139 [self _addItemWithTitle:@"Enable Visual Viewport" action:@selector(toggleVisualViewportEnabled:) indented:NO]; 138 140 [self _addItemWithTitle:@"Enable Resource Load Statistics" action:@selector(toggleResourceLoadStatisticsEnabled:) indented:NO]; … … 219 221 else if (action == @selector(toggleDisplayListDrawingEnabled:)) 220 222 [menuItem setState:[self displayListDrawingEnabled] ? NSOnState : NSOffState]; 223 else if (action == @selector(toggleSubpixelAntialiasedLayerTextEnabled:)) 224 [menuItem setState:[self subpixelAntialiasedLayerTextEnabled] ? NSOnState : NSOffState]; 221 225 else if (action == @selector(toggleResourceLoadStatisticsEnabled:)) 222 226 [menuItem setState:[self resourceLoadStatisticsEnabled] ? NSOnState : NSOffState]; … … 399 403 } 400 404 405 - (void)toggleSubpixelAntialiasedLayerTextEnabled:(id)sender 406 { 407 [self _toggleBooleanDefault:SubpixelAntialiasedLayerTextEnabledPreferenceKey]; 408 } 409 410 - (BOOL)subpixelAntialiasedLayerTextEnabled 411 { 412 return [[NSUserDefaults standardUserDefaults] boolForKey:SubpixelAntialiasedLayerTextEnabledPreferenceKey]; 413 } 414 401 415 - (void)toggleReserveSpaceForBanners:(id)sender 402 416 { -
trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m
r212195 r212776 270 270 [[WebPreferences standardPreferences] setSuppressesIncrementalRendering:settings.incrementalRenderingSuppressed]; 271 271 [[WebPreferences standardPreferences] setAcceleratedDrawingEnabled:settings.acceleratedDrawingEnabled]; 272 [[WebPreferences standardPreferences] setSubpixelAntialiasedLayerTextEnabled:settings.subpixelAntialiasedLayerTextEnabled]; 272 273 [[WebPreferences standardPreferences] setResourceLoadStatisticsEnabled:settings.resourceLoadStatisticsEnabled]; 273 274 [[WebPreferences standardPreferences] setVisualViewportEnabled:settings.visualViewportEnabled]; -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r211135 r212776 376 376 preferences._resourceUsageOverlayVisible = settings.resourceUsageOverlayVisible; 377 377 preferences._displayListDrawingEnabled = settings.displayListDrawingEnabled; 378 preferences._subpixelAntialiasedLayerTextEnabled = settings.subpixelAntialiasedLayerTextEnabled; 378 379 preferences._visualViewportEnabled = settings.visualViewportEnabled; 379 380 preferences._largeImageAsyncDecodingEnabled = settings.largeImageAsyncDecodingEnabled; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r212757 r212776 643 643 WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true); 644 644 WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing); 645 WKPreferencesSetSubpixelAntialiasedLayerTextEnabled(preferences, false); 645 646 WKPreferencesSetXSSAuditorEnabled(preferences, false); 646 647 WKPreferencesSetWebAudioEnabled(preferences, true);
Note: See TracChangeset
for help on using the changeset viewer.