Title: [292294] trunk
Revision
292294
Author
[email protected]
Date
2022-04-04 10:20:49 -0700 (Mon, 04 Apr 2022)

Log Message

[GPU Process] [iOS] Sometimes the text drop shadow is not drawn
https://bugs.webkit.org/show_bug.cgi?id=236923
rdar://89196794

Reviewed by Simon Fraser.

Source/WebCore:

The baseCTM of internal context of DrawGlyphsRecorder has to match the
baseCTM of the owner DisplayList::Recorder.

When recording the glyph runs, DrawGlyphsRecorder::recordDrawGlyphs()
updates the shadow of the recorder such that ShadowsIgnoreTransforms is
set to "false". That means no shadow transformation will be applied to
the offset or the blur radius in GPUP.

* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
(WebCore::DrawGlyphsRecorder::populateInternalState):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
* platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* platform/graphics/win/DrawGlyphsRecorderWin.cpp:
(WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
* rendering/RenderThemeIOS.mm:
(WebCore::paintAttachmentText):

LayoutTests:

Unskip failed the text drop shadow layout test.

* platform/ios-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (292293 => 292294)


--- trunk/LayoutTests/ChangeLog	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/LayoutTests/ChangeLog	2022-04-04 17:20:49 UTC (rev 292294)
@@ -1,3 +1,15 @@
+2022-04-04  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] [iOS] Sometimes the text drop shadow is not drawn
+        https://bugs.webkit.org/show_bug.cgi?id=236923
+        rdar://89196794
+
+        Reviewed by Simon Fraser.
+
+        Unskip failed the text drop shadow layout test.
+
+        * platform/ios-wk2/TestExpectations:
+
 2022-04-04  Cathie Chen  <[email protected]>
 
         REGRESSION(r291797): [wk1] 5 contain-intrinsic-size* tests are constant text failures

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (292293 => 292294)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-04-04 17:20:49 UTC (rev 292294)
@@ -2210,12 +2210,9 @@
 # Wrong text color
 webkit.org/b/236913 imported/blink/fast/multicol/vertical-lr/float-content-break.html [ ImageOnlyFailure ]
 
-# No/bad colored boxes
-webkit.org/b/236923 fast/css/paint-order-shadow.html [ ImageOnlyFailure ]
-webkit.org/b/236923 imported/blink/svg/text/obb-paintserver.html [ ImageOnlyFailure ]
-
 # No/bad gradient/pattern
 webkit.org/b/236924 svg/transforms/transformed-text-fill-pattern.html [ ImageOnlyFailure ]
+webkit.org/b/236924 imported/blink/svg/text/obb-paintserver.html [ ImageOnlyFailure ]
 
 # Media failures
 webkit.org/b/237295 fast/mediastream/video-rotation-gpu-process-crash.html [ Timeout Crash Pass ]

Modified: trunk/Source/WebCore/ChangeLog (292293 => 292294)


--- trunk/Source/WebCore/ChangeLog	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/ChangeLog	2022-04-04 17:20:49 UTC (rev 292294)
@@ -1,3 +1,32 @@
+2022-04-04  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] [iOS] Sometimes the text drop shadow is not drawn
+        https://bugs.webkit.org/show_bug.cgi?id=236923
+        rdar://89196794
+
+        Reviewed by Simon Fraser.
+
+        The baseCTM of internal context of DrawGlyphsRecorder has to match the
+        baseCTM of the owner DisplayList::Recorder.
+
+        When recording the glyph runs, DrawGlyphsRecorder::recordDrawGlyphs()
+        updates the shadow of the recorder such that ShadowsIgnoreTransforms is
+        set to "false". That means no shadow transformation will be applied to
+        the offset or the blur radius in GPUP.
+
+        * platform/graphics/DrawGlyphsRecorder.h:
+        * platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        (WebCore::DrawGlyphsRecorder::populateInternalState):
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::Recorder):
+        * platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        * platform/graphics/win/DrawGlyphsRecorderWin.cpp:
+        (WebCore::DrawGlyphsRecorder::DrawGlyphsRecorder):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::paintAttachmentText):
+
 2022-04-04  Youenn Fablet  <[email protected]>
 
         CORS: Allow particular Range header values without a preflight

Modified: trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h (292293 => 292294)


--- trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h	2022-04-04 17:20:49 UTC (rev 292294)
@@ -55,7 +55,7 @@
 public:
     enum class DeconstructDrawGlyphs : bool { No, Yes };
     enum class DeriveFontFromContext : bool { No, Yes };
-    explicit DrawGlyphsRecorder(GraphicsContext&, DeconstructDrawGlyphs = DeconstructDrawGlyphs::No, DeriveFontFromContext = DeriveFontFromContext::No);
+    explicit DrawGlyphsRecorder(GraphicsContext&, float scaleFactor = 1, DeconstructDrawGlyphs = DeconstructDrawGlyphs::No, DeriveFontFromContext = DeriveFontFromContext::No);
 
     void drawGlyphs(const Font&, const GlyphBufferGlyph*, const GlyphBufferAdvance*, unsigned numGlyphs, const FloatPoint& anchorPoint, FontSmoothingMode);
 

Modified: trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp (292293 => 292294)


--- trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp	2022-04-04 17:20:49 UTC (rev 292294)
@@ -86,12 +86,13 @@
     return makeUniqueRef<GraphicsContextCG>(context.get());
 }
 
-DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DeconstructDrawGlyphs deconstructDrawGlyphs, DeriveFontFromContext deriveFontFromContext)
+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, float scaleFactor, DeconstructDrawGlyphs deconstructDrawGlyphs, DeriveFontFromContext deriveFontFromContext)
     : m_owner(owner)
     , m_deconstructDrawGlyphs(deconstructDrawGlyphs)
     , m_deriveFontFromContext(deriveFontFromContext)
     , m_internalContext(createInternalContext())
 {
+    m_internalContext->applyDeviceScaleFactor(scaleFactor);
 }
 
 void DrawGlyphsRecorder::populateInternalState(const GraphicsContextState& contextState)
@@ -99,7 +100,7 @@
     m_originalState.fillBrush = contextState.fillBrush();
     m_originalState.strokeBrush = contextState.strokeBrush();
 
-    m_originalState.ctm = m_owner.getCTM(); // FIXME: Deal with base CTM.
+    m_originalState.ctm = m_owner.getCTM();
 
     m_originalState.dropShadow = contextState.dropShadow();
     m_originalState.ignoreTransforms = contextState.shadowsIgnoreTransforms();

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (292293 => 292294)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-04-04 17:20:49 UTC (rev 292294)
@@ -48,7 +48,7 @@
 
 Recorder::Recorder(const GraphicsContextState& state, const FloatRect& initialClip, const AffineTransform& initialCTM, DrawGlyphsRecorder::DeconstructDrawGlyphs deconstructDrawGlyphs)
     : GraphicsContext(state)
-    , m_drawGlyphsRecorder(*this, deconstructDrawGlyphs)
+    , m_drawGlyphsRecorder(*this, initialCTM.xScale(), deconstructDrawGlyphs)
 {
     m_stateStack.append({ state, initialCTM, initialCTM.mapRect(initialClip) });
 }

Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp (292293 => 292294)


--- trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/DrawGlyphsRecorderHarfBuzz.cpp	2022-04-04 17:20:49 UTC (rev 292294)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DeconstructDrawGlyphs, DeriveFontFromContext)
+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, float, DeconstructDrawGlyphs, DeriveFontFromContext)
     : m_owner(owner)
 {
 }

Modified: trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp (292293 => 292294)


--- trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/platform/graphics/win/DrawGlyphsRecorderWin.cpp	2022-04-04 17:20:49 UTC (rev 292294)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, DeconstructDrawGlyphs, DeriveFontFromContext)
+DrawGlyphsRecorder::DrawGlyphsRecorder(GraphicsContext& owner, float, DeconstructDrawGlyphs, DeriveFontFromContext)
     : m_owner(owner)
 {
 }

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (292293 => 292294)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2022-04-04 17:07:24 UTC (rev 292293)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2022-04-04 17:20:49 UTC (rev 292294)
@@ -1922,7 +1922,7 @@
 
 static void paintAttachmentText(GraphicsContext& context, RenderAttachmentInfo& info)
 {
-    DrawGlyphsRecorder recorder(context, DrawGlyphsRecorder::DeconstructDrawGlyphs::Yes, DrawGlyphsRecorder::DeriveFontFromContext::Yes);
+    DrawGlyphsRecorder recorder(context, 1, DrawGlyphsRecorder::DeconstructDrawGlyphs::Yes, DrawGlyphsRecorder::DeriveFontFromContext::Yes);
 
     for (const auto& line : info.lines)
         recorder.drawNativeText(line.font.get(), CTFontGetSize(line.font.get()), line.line.get(), line.rect);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to