Title: [239677] tags/Safari-607.1.18.1
Revision
239677
Author
[email protected]
Date
2019-01-07 09:50:35 -0800 (Mon, 07 Jan 2019)

Log Message

Cherry-pick r239591. rdar://problem/47014944

    REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
    https://bugs.webkit.org/show_bug.cgi?id=193095
    <rdar://problem/47014944>

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
    and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
    which continues to affect the appearance of text.

    Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.

    Test: compositing/contents-format/subpixel-antialiased-text.html

    * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
    (WebCore::PlatformCALayer::drawLayerContents):

    LayoutTests:

    A ref test that compares the rendering of layer and non-layer text with smoothing and antialiasing.

    * compositing/contents-format/subpixel-antialiased-text-expected.html: Added.
    * compositing/contents-format/subpixel-antialiased-text.html: Added.
    * platform/mac/TestExpectations:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239591 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: tags/Safari-607.1.18.1/LayoutTests/ChangeLog (239676 => 239677)


--- tags/Safari-607.1.18.1/LayoutTests/ChangeLog	2019-01-07 17:06:25 UTC (rev 239676)
+++ tags/Safari-607.1.18.1/LayoutTests/ChangeLog	2019-01-07 17:50:35 UTC (rev 239677)
@@ -1,3 +1,50 @@
+2019-01-07  Alan Coon  <[email protected]>
+
+        Cherry-pick r239591. rdar://problem/47014944
+
+    REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
+    https://bugs.webkit.org/show_bug.cgi?id=193095
+    <rdar://problem/47014944>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
+    and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
+    which continues to affect the appearance of text.
+    
+    Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
+    
+    Test: compositing/contents-format/subpixel-antialiased-text.html
+    
+    * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+    (WebCore::PlatformCALayer::drawLayerContents):
+    
+    LayoutTests:
+    
+    A ref test that compares the rendering of layer and non-layer text with smoothing and antialiasing.
+    
+    * compositing/contents-format/subpixel-antialiased-text-expected.html: Added.
+    * compositing/contents-format/subpixel-antialiased-text.html: Added.
+    * platform/mac/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-02  Simon Fraser  <[email protected]>
+
+            REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
+            https://bugs.webkit.org/show_bug.cgi?id=193095
+            <rdar://problem/47014944>
+
+            Reviewed by Zalan Bujtas.
+
+            A ref test that compares the rendering of layer and non-layer text with smoothing and antialiasing.
+
+            * compositing/contents-format/subpixel-antialiased-text-expected.html: Added.
+            * compositing/contents-format/subpixel-antialiased-text.html: Added.
+            * platform/mac/TestExpectations:
+
 2018-12-31  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Support PHP 7.3 in Debian.

Added: tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text-expected.html (0 => 239677)


--- tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text-expected.html	                        (rev 0)
+++ tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text-expected.html	2019-01-07 17:50:35 UTC (rev 239677)
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            display: inline-block;
+            height: 100px;
+            width: 220px;
+            padding: 5px;
+            margin: 10px;
+            border: 1px solid black;
+            box-sizing: border-box;
+            font-family: monospace;
+        }
+
+        .antialiased {
+            -webkit-font-smoothing: antialiased;
+        }
+
+        .smoothed {
+            -webkit-font-smoothing: subpixel-antialiased;
+        }
+    </style>
+    <script>
+        if (window.internals) {
+            internals.setFontSmoothingEnabled(true);
+            internals.settings.setSubpixelAntialiasedLayerTextEnabled(true)
+        }
+    </script>
+</head>
+<body>
+
+<h2>Composited vs. non-composited</h2>
+<section>
+<div class="container">
+    This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+</div>
+
+<div class="container">
+    This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+</div>
+</section>
+
+<h2>Non-composited: antialiased vs. smoothed</h2>
+
+<section>
+    <div class="container antialiased">
+        This text should look visibly thinner.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+
+    <div class="container smoothed">
+        This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+</section>
+
+<h2>Composited: antialiased vs. smoothed</h2>
+
+<section>
+    <div class="container antialiased">
+        This text should look visibly thinner.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+
+    <div class="container smoothed">
+        This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+</section>
+
+
+</body>
+</html>

Added: tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text.html (0 => 239677)


--- tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text.html	                        (rev 0)
+++ tags/Safari-607.1.18.1/LayoutTests/compositing/contents-format/subpixel-antialiased-text.html	2019-01-07 17:50:35 UTC (rev 239677)
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            display: inline-block;
+            height: 100px;
+            width: 220px;
+            padding: 5px;
+            margin: 10px;
+            border: 1px solid black;
+            box-sizing: border-box;
+            font-family: monospace;
+        }
+
+        .composited {
+            will-change: transform;
+        }
+
+        .antialiased {
+            -webkit-font-smoothing: antialiased;
+        }
+
+        .smoothed {
+            -webkit-font-smoothing: subpixel-antialiased;
+        }
+    </style>
+    <script>
+        if (window.internals) {
+            internals.setFontSmoothingEnabled(true);
+            internals.settings.setSubpixelAntialiasedLayerTextEnabled(true)
+        }
+    </script>
+</head>
+<body>
+
+<h2>Composited vs. non-composited</h2>
+<section>
+<div class="container">
+    This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+</div>
+
+<div class="composited container">
+    This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+</div>
+</section>
+
+<h2>Non-composited: antialiased vs. smoothed</h2>
+
+<section>
+    <div class="container antialiased">
+        This text should look visibly thinner.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+
+    <div class="container smoothed">
+        This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+</section>
+
+<h2>Composited: antialiased vs. smoothed</h2>
+
+<section>
+    <div class="container composited antialiased">
+        This text should look visibly thinner.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+
+    <div class="container composited smoothed">
+        This text should have the normal appearance.<br> a b c d e f g h i j k l m n o p q r s t u v w x y z
+    </div>
+</section>
+
+
+</body>
+</html>

Modified: tags/Safari-607.1.18.1/LayoutTests/platform/mac/TestExpectations (239676 => 239677)


--- tags/Safari-607.1.18.1/LayoutTests/platform/mac/TestExpectations	2019-01-07 17:06:25 UTC (rev 239676)
+++ tags/Safari-607.1.18.1/LayoutTests/platform/mac/TestExpectations	2019-01-07 17:50:35 UTC (rev 239677)
@@ -1752,6 +1752,9 @@
 [ Mojave+ ] imported/blink/fast/text/international/text-shaping-arabic.html [ ImageOnlyFailure ]
 [ Mojave+ ] imported/blink/fast/text/international/vertical-positioning-with-combining-marks.html [ ImageOnlyFailure ]
 
+# < Mojave uses font smoothing.
+[ Sierra HighSierra ] compositing/contents-format/subpixel-antialiased-text.html [ ImageOnlyFailure ]
+
 # < Mojave doesn't support the CG needed for Conic Gradients
 [ Mojave+ ] http/wpt/css/css-images-4/conic-gradient-parsing.html [ Pass ]
 [ Mojave+ ] fast/gradients/conic-repeating.html [ Pass ]
@@ -1813,4 +1816,4 @@
 webkit.org/b/192956 [ Sierra ] webgpu/webgpu-basics.html [ Skip ]
 webkit.org/b/192956 [ Sierra ] webgpu/webgpu-enabled.html [ Skip ]
 webkit.org/b/192956 [ Sierra ] webgpu/simple-triangle-strip.html [ Skip ]
-webkit.org/b/192956 [ Sierra ] webgpu/vertex-buffer-triangle-strip.html [ Skip ]
\ No newline at end of file
+webkit.org/b/192956 [ Sierra ] webgpu/vertex-buffer-triangle-strip.html [ Skip ]

Modified: tags/Safari-607.1.18.1/Source/WebCore/ChangeLog (239676 => 239677)


--- tags/Safari-607.1.18.1/Source/WebCore/ChangeLog	2019-01-07 17:06:25 UTC (rev 239676)
+++ tags/Safari-607.1.18.1/Source/WebCore/ChangeLog	2019-01-07 17:50:35 UTC (rev 239677)
@@ -1,3 +1,55 @@
+2019-01-07  Alan Coon  <[email protected]>
+
+        Cherry-pick r239591. rdar://problem/47014944
+
+    REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
+    https://bugs.webkit.org/show_bug.cgi?id=193095
+    <rdar://problem/47014944>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
+    and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
+    which continues to affect the appearance of text.
+    
+    Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
+    
+    Test: compositing/contents-format/subpixel-antialiased-text.html
+    
+    * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+    (WebCore::PlatformCALayer::drawLayerContents):
+    
+    LayoutTests:
+    
+    A ref test that compares the rendering of layer and non-layer text with smoothing and antialiasing.
+    
+    * compositing/contents-format/subpixel-antialiased-text-expected.html: Added.
+    * compositing/contents-format/subpixel-antialiased-text.html: Added.
+    * platform/mac/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-02  Simon Fraser  <[email protected]>
+
+            REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
+            https://bugs.webkit.org/show_bug.cgi?id=193095
+            <rdar://problem/47014944>
+
+            Reviewed by Zalan Bujtas.
+
+            In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
+            and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
+            which continues to affect the appearance of text.
+
+            Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
+
+            Test: compositing/contents-format/subpixel-antialiased-text.html
+
+            * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+            (WebCore::PlatformCALayer::drawLayerContents):
+
 2018-12-30  David Kilzer  <[email protected]>
 
         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge

Modified: tags/Safari-607.1.18.1/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (239676 => 239677)


--- tags/Safari-607.1.18.1/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2019-01-07 17:06:25 UTC (rev 239676)
+++ tags/Safari-607.1.18.1/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm	2019-01-07 17:50:35 UTC (rev 239677)
@@ -1184,7 +1184,7 @@
         graphicsContext.setIsCALayerContext(true);
         graphicsContext.setIsAcceleratedContext(platformCALayer->acceleratesDrawing());
         
-        if (!layerContents->platformCALayerContentsOpaque() && !platformCALayer->supportsSubpixelAntialiasedText()) {
+        if (!layerContents->platformCALayerContentsOpaque() && !platformCALayer->supportsSubpixelAntialiasedText() && FontCascade::isSubpixelAntialiasingAvailable()) {
             // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
             graphicsContext.setShouldSmoothFonts(false);
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to