Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d0ecc42ca2afd958eb7831d67e5bdb19c48ab007
      
https://github.com/WebKit/WebKit/commit/d0ecc42ca2afd958eb7831d67e5bdb19c48ab007
  Author: Yusuke Suzuki <[email protected]>
  Date:   2024-04-08 (Mon, 08 Apr 2024)

  Changed paths:
    M 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/import/text-intro-02-b-manual-expected.txt
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h
    M Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/rendering/RenderText.h
    M Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
    M Source/WebCore/rendering/svg/RenderSVGInlineText.h
    M Source/WebCore/rendering/svg/RenderSVGText.cpp
    M Source/WebCore/rendering/svg/RenderSVGText.h
    M Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp
    M Source/WebCore/rendering/svg/SVGTextMetrics.cpp
    M Source/WebCore/rendering/svg/SVGTextMetrics.h
    M Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
    M Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h

  Log Message:
  -----------
  [SVG] Clean up SVGTextMetricsBuilder
https://bugs.webkit.org/show_bug.cgi?id=271717
rdar://125428940

Reviewed by Cameron McCormack.

This patch adds optimized fast path for SVGTextMetricsBuilder.

1. We reorganized RenderSVGText::layout so that we no longer call 
SVGTextMetricsBuilder multiple times
   unnecessarily in one layout. We should call once per layout.
2. We use canUseSimplifiedTextMeasuring information from RenderSVGInlineText 
(this flag gets updated correctly based on style change etc.).
   And based on that, we use super tuned fast path for SVGTextMetrics 
collection. We use FontCascade's WidthCache well. And we skip various
   unnecessarily costly operation done for per character basis on the normal 
path.
3. Clean up SVGTextMetricsBuilder code. Make MeasureTextData const parameter 
for SVGTextMetricsBuilder::measureTextRenderer to make input
   and output much more explicit and stateless. Remove many unnecessary 
branches.

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleTextWithFixedPitch const):
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::widthForTextUsingSimplifiedMeasuring const):
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
(WebCore::updateFontInAllDescendants):
(WebCore::RenderSVGText::layout):
(WebCore::RenderSVGText::willLayout): Deleted.
* Source/WebCore/rendering/svg/RenderSVGText.h:
* Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
(WebCore::MeasureTextData::MeasureTextData):
(WebCore::SVGTextMetricsBuilder::measureTextRenderer):
(WebCore::SVGTextMetricsBuilder::walkTree):
(WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
* Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h:

Canonical link: https://commits.webkit.org/277214@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to