Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 23619bf93e9cbd28c08b0410deb4c72ebe1337a5 https://github.com/WebKit/WebKit/commit/23619bf93e9cbd28c08b0410deb4c72ebe1337a5 Author: Fujii Hironori <fu...@igalia.com> Date: 2025-08-30 (Sat, 30 Aug 2025)
Changed paths: M LayoutTests/platform/gtk/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt M Source/WTF/wtf/PlatformEnableGlib.h M Source/WebCore/platform/graphics/FontCascade.cpp M Source/WebCore/platform/graphics/FontCascade.h M Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp M Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp Log Message: ----------- Use ComplexTextController even for the simple text code path for GTK and WPE ports https://bugs.webkit.org/show_bug.cgi?id=297843 Reviewed by Nikolas Zimmermann and Vitor Roriz. <https://commits.webkit.org/200076@main> changed GTK and WPE ports to always use the complex text code path. This was done by using `FontCascade::setCodePath(CodePath::Complex)`. However, this approach involved a unnecessary performance regression. In most of layout perf test cases, the complex and simple text code paths consume only a tiny portion of time. In WebCore layout and rendering code, there are some conditions checking the code path like `if (fontCascade.codePath(TextRun(content)) == FontCascade::CodePath::Complex)`. This yields the difference in performance. For example, the following condition in LineBoxBuilder::collectFallbackFonts is a condition making the difference. if (inlineTextBox.canUseSimplifiedContentMeasuring()) { // Simplified text measuring works with primary font only. return { }; } Thus, we shouldn't use `FontCascade::setCodePath()` to choose the complex text code path. To use the simple text code path, we have to implement Font::applyTransforms() for shaping the text. In bug#297088, I studied the possibility of implementing Font::applyTransforms with HarfBuzz. However, HarfBuzz doesn't have an API to implement Font::applyTransforms efficiently. Use ComplexTextController even for the simple text code path for GTK and WPE ports. Added a new macro ENABLE_COMPLEX_TEXT_CONTROLLER_FOR_SIMPLE_CODE_PATH. * LayoutTests/platform/gtk/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt: * Source/WTF/wtf/PlatformEnableGlib.h: * Source/WebCore/platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::width const): (WebCore::FontCascade::adjustSelectionRectForText const): (WebCore::FontCascade::offsetForPosition const): (WebCore::FontCascade::codePath const): (WebCore::FontCascade::widthForCharacterInRun const): (WebCore::FontCascade::lineSegmentsForIntersectionsWithRect const): * Source/WebCore/platform/graphics/FontCascade.h: (WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const): * Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer): * Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitialize): Canonical link: https://commits.webkit.org/299354@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes