[webkit-changes] [WebKit/WebKit] 82682c: Optimize SVGRenderSupport::layoutDifferentRootIfNe...

Simon Fraser noreply at github.com
Fri Jan 5 10:50:32 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82682c1a0a673dc7b4ae28fef1ee9c8a3209d4fd
      https://github.com/WebKit/WebKit/commit/82682c1a0a673dc7b4ae28fef1ee9c8a3209d4fd
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
    M Source/WebCore/rendering/svg/SVGRenderSupport.cpp
    M Source/WebCore/rendering/svg/SVGResources.cpp
    M Source/WebCore/rendering/svg/SVGResources.h

  Log Message:
  -----------
  Optimize SVGRenderSupport::layoutDifferentRootIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=267014
rdar://120392477

Reviewed by Said Abou-Hallawa.

SVGRenderSupport::layoutDifferentRootIfNeeded() shows up on profiles of the Suits
MotionMark subtest.

We only need to call findTreeRootObject() on the renderer if the there are any  clipper, masker,
filters etc are present, so pass the RenderElement which is the client of the SVG resources,
and lazily call findTreeRootObject() on it when necessary.

Also check m_clipperFilterMaskerData and m_markerData before calling the lambda on their
contents.

* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::layoutDifferentRootIfNeeded):
* Source/WebCore/rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::layoutDifferentRootIfNeeded):
* Source/WebCore/rendering/svg/SVGResources.h:

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




More information about the webkit-changes mailing list