Title: [292198] trunk
- Revision
- 292198
- Author
- [email protected]
- Date
- 2022-03-31 20:39:53 -0700 (Thu, 31 Mar 2022)
Log Message
[GPU Process] [iOS] Vertical text is incorrectly displaced
https://bugs.webkit.org/show_bug.cgi?id=232917
rdar://85483031
Reviewed by Myles C. Maxfield.
Source/WebCore:
DrawGlyphsRecorder calls FontCascade::drawGlyphs() which calls CoreText
to draw the vertical text to its internal context. This internal context
is setup to be called back for every single run. When CoreText calls
DrawGlyphsRecorder::recordDrawGlyphs(), it records drawing the glyph runs
into the owner recorder. The problem is CoreText passes the transformed
positions to recordDrawGlyphs(). To call drawGlyphsAndCacheFont() in the
recorder we have to pass the un-transformed anchor point. To get this anchor
point, we have to apply the inverse of fillVectorWithVerticalGlyphPositions()
to the first transformed position.
* platform/graphics/GraphicsContext.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
LayoutTests:
Unskip failed vertical text layout tests.
* platform/ios-wk2/TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (292197 => 292198)
--- trunk/LayoutTests/ChangeLog 2022-04-01 02:49:53 UTC (rev 292197)
+++ trunk/LayoutTests/ChangeLog 2022-04-01 03:39:53 UTC (rev 292198)
@@ -1,3 +1,15 @@
+2022-03-31 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] [iOS] Vertical text is incorrectly displaced
+ https://bugs.webkit.org/show_bug.cgi?id=232917
+ rdar://85483031
+
+ Reviewed by Myles C. Maxfield.
+
+ Unskip failed vertical text layout tests.
+
+ * platform/ios-wk2/TestExpectations:
+
2022-03-31 Fujii Hironori <[email protected]>
[WinCairo] Unreviewed test gardening
Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (292197 => 292198)
--- trunk/LayoutTests/platform/ios-wk2/TestExpectations 2022-04-01 02:49:53 UTC (rev 292197)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations 2022-04-01 03:39:53 UTC (rev 292198)
@@ -2207,17 +2207,6 @@
# Test failures from turning GPU Process on by default
webkit.org/b/234536 webxr/high-performance.html [ Failure ]
-# There is text in/near the box
-webkit.org/b/236907 imported/w3c/web-platform-tests/css/css-flexbox/css-flexbox-test1.html [ ImageOnlyFailure ]
-
-# Misplaced text
-webkit.org/b/236908 fast/text/cjk-multi-codepoint-cluster-vertical.html [ ImageOnlyFailure ]
-webkit.org/b/236908 fast/text/multiple-codeunit-vertical-upright-2.html [ ImageOnlyFailure ]
-webkit.org/b/236908 fast/text/multiple-codeunit-vertical-upright.html [ ImageOnlyFailure ]
-
-# Red text pokes out
-webkit.org/b/236911 fast/text/international/synthesized-italic-vertical.html [ ImageOnlyFailure ]
-
# Not sure if the orange line diff is negligible or important
webkit.org/b/236912 http/wpt/css/css-highlight-api/highlight-text-decorations.html [ ImageOnlyFailure ]
@@ -2225,27 +2214,6 @@
webkit.org/b/236913 fast/css/variables/test-suite/005.html [ ImageOnlyFailure Pass ]
webkit.org/b/236913 imported/blink/fast/multicol/vertical-lr/float-content-break.html [ ImageOnlyFailure ]
-# There are small rectangles or characters below main character
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ch-unit-011.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-002.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-003.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-009.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html [ ImageOnlyFailure ]
-webkit.org/b/236916 imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html [ ImageOnlyFailure ]
-
-# Writing mode failures
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/central-baseline-alignment-002.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/inline-block-alignment-004.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/inline-block-alignment-orthogonal-vlr-005.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/inline-block-alignment-orthogonal-vrl-004.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/inline-table-alignment-004.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/text-baseline-vlr-005.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/text-baseline-vrl-004.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/text-shadow-orientation-upright-001.html [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/vertical-alignment-vlr-023.xht [ ImageOnlyFailure ]
-webkit.org/b/236921 imported/w3c/web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-022.xht [ 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 ]
Modified: trunk/Source/WebCore/ChangeLog (292197 => 292198)
--- trunk/Source/WebCore/ChangeLog 2022-04-01 02:49:53 UTC (rev 292197)
+++ trunk/Source/WebCore/ChangeLog 2022-04-01 03:39:53 UTC (rev 292198)
@@ -1,3 +1,25 @@
+2022-03-31 Said Abou-Hallawa <[email protected]>
+
+ [GPU Process] [iOS] Vertical text is incorrectly displaced
+ https://bugs.webkit.org/show_bug.cgi?id=232917
+ rdar://85483031
+
+ Reviewed by Myles C. Maxfield.
+
+ DrawGlyphsRecorder calls FontCascade::drawGlyphs() which calls CoreText
+ to draw the vertical text to its internal context. This internal context
+ is setup to be called back for every single run. When CoreText calls
+ DrawGlyphsRecorder::recordDrawGlyphs(), it records drawing the glyph runs
+ into the owner recorder. The problem is CoreText passes the transformed
+ positions to recordDrawGlyphs(). To call drawGlyphsAndCacheFont() in the
+ recorder we have to pass the un-transformed anchor point. To get this anchor
+ point, we have to apply the inverse of fillVectorWithVerticalGlyphPositions()
+ to the first transformed position.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
+ (WebCore::DrawGlyphsRecorder::recordDrawGlyphs):
+
2022-03-31 Chris Dumez <[email protected]>
Prepare WebKit/ & WebKitLegacy/ for making the String(const char*) constructor explicit
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (292197 => 292198)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2022-04-01 02:49:53 UTC (rev 292197)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2022-04-01 03:39:53 UTC (rev 292198)
@@ -51,17 +51,12 @@
class Gradient;
class GraphicsContextPlatformPrivate;
class ImageBuffer;
-class IntRect;
class MediaPlayer;
-class RoundedRect;
class GraphicsContextGL;
class Path;
class SystemImage;
class TextRun;
-class TransformationMatrix;
-struct GraphicsContextStateChange;
-
class GraphicsContext {
WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
public:
Modified: trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp (292197 => 292198)
--- trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp 2022-04-01 02:49:53 UTC (rev 292197)
+++ trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp 2022-04-01 03:39:53 UTC (rev 292198)
@@ -256,12 +256,21 @@
// `FontCascade::drawGlyphs` we need to recalculate the original advances from the resulting
// positions by inverting the operations applied to the original advances.
auto textMatrix = m_originalTextMatrix;
+ auto initialPenPosition = textMatrix.mapPoint(positions[0]);
+
if (font->platformData().orientation() == FontOrientation::Vertical) {
// Keep this in sync as the inverse of `fillVectorWithVerticalGlyphPositions`.
- // FIXME: <https://webkit.org/b/232917> (`DrawGlyphsRecorder` should be able to record+replay vertical text)
+ // FIXME: Use rotateLeftTransform(), as fillVectorWithVerticalGlyphPositions() does, instead of using transposedSize().
+ CGSize translation;
+ CTFontGetVerticalTranslationsForGlyphs(font->platformData().ctFont(), glyphs, &translation, 1);
+
+ initialPenPosition += FloatSize(translation).transposedSize();
+
+ auto ascentDelta = font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent();
+ initialPenPosition.move(0, -ascentDelta);
}
- m_owner.drawGlyphsAndCacheFont(font, glyphs, computeAdvancesFromPositions(positions, count, textMatrix).data(), count, textMatrix.mapPoint(positions[0]), m_smoothingMode);
+ m_owner.drawGlyphsAndCacheFont(font, glyphs, computeAdvancesFromPositions(positions, count, textMatrix).data(), count, initialPenPosition, m_smoothingMode);
m_owner.concatCTM(inverseCTMFixup);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes