REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2018 01:56:48 +0000 (01:56 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2018 01:56:48 +0000 (01:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187336

Reviewed by Carlos Garcia Campos.

Source/WebCore:

drawGlyphsShadow has a fast path to draw a shadow without a shadow
layer. Since r233495, it is not used for zero blur-radius shadow.

In Bug 187244, I changed ShadowState::isRequired not to check
blur-radius is zero. This is not a right fix.

This change reverts r233495.

No new tests (Covered by existing tests).

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Return false if
'blur' is zero.
(WebCore::Cairo::fillRectWithRoundedHole): Use
ShadowState::isVisible instead of ShadowState::isRequired to check
a shadow should be drawn.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked fast/text/multiple-text-shadow-overflow-layout-rect.html.

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/CairoOperations.cpp

index edaa3f2..14e7d5d 100644 (file)
@@ -1,3 +1,12 @@
+2018-07-05  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
+        https://bugs.webkit.org/show_bug.cgi?id=187336
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: Unmarked fast/text/multiple-text-shadow-overflow-layout-rect.html.
+
 2018-07-05  Saam Barati  <sbarati@apple.com>
 
         [mac-wk1] Layout Test editing/selection/navigation-clears-editor-state.html is a flaky failure
index 3e222d1..c846d7e 100644 (file)
@@ -3471,8 +3471,6 @@ webkit.org/b/187271 fast/text/emoji-with-joiner.html [ Failure ]
 
 webkit.org/b/187323 imported/w3c/web-platform-tests/web-animations/timing-model/timelines/timelines.html [ Failure ]
 
-webkit.org/b/187324 fast/text/multiple-text-shadow-overflow-layout-rect.html [ ImageOnlyFailure ]
-
 webkit.org/b/187325 http/wpt/css/css-animations/start-animation-001.html [ ImageOnlyFailure ]
 
 #////////////////////////////////////////////////////////////////////////////////////////
index 83791ef..248c190 100644 (file)
@@ -1,3 +1,27 @@
+2018-07-05  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
+        https://bugs.webkit.org/show_bug.cgi?id=187336
+
+        Reviewed by Carlos Garcia Campos.
+
+        drawGlyphsShadow has a fast path to draw a shadow without a shadow
+        layer. Since r233495, it is not used for zero blur-radius shadow.
+
+        In Bug 187244, I changed ShadowState::isRequired not to check
+        blur-radius is zero. This is not a right fix.
+
+        This change reverts r233495.
+
+        No new tests (Covered by existing tests).
+
+        * platform/graphics/cairo/CairoOperations.cpp:
+        (WebCore::Cairo::ShadowState::isRequired const): Return false if
+        'blur' is zero.
+        (WebCore::Cairo::fillRectWithRoundedHole): Use
+        ShadowState::isVisible instead of ShadowState::isRequired to check
+        a shadow should be drawn.
+
 2018-07-05  Timothy Hatcher  <timothy@apple.com>
 
         Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
index fd92e2f..b7ae4e8 100644 (file)
@@ -612,7 +612,8 @@ bool ShadowState::isVisible() const
 
 bool ShadowState::isRequired(PlatformContextCairo& platformContext) const
 {
-    if (color.isVisible())
+    // We can't avoid ShadowBlur if the shadow has blur.
+    if (color.isVisible() && blur)
         return true;
 
     // We can avoid ShadowBlur and optimize, since we're not drawing on a
@@ -734,7 +735,7 @@ void fillRectWithRoundedHole(PlatformContextCairo& platformContext, const FloatR
 {
     // FIXME: this should leverage the specified color.
 
-    if (shadowState.isRequired(platformContext)) {
+    if (shadowState.isVisible()) {
         ShadowBlur shadow({ shadowState.blur, shadowState.blur }, shadowState.offset, shadowState.color, shadowState.ignoreTransforms);
         shadow.drawInsetShadow(State::getCTM(platformContext), State::getClipBounds(platformContext), rect, roundedHoleRect,
             [&platformContext, &shadowState](ImageBuffer& layerImage, const FloatPoint& layerOrigin, const FloatSize& layerSize, const FloatRect& sourceRect)