Bug 207451 - RenderSVGShape invalidates all its resources when it needs layout, but is that necessary?
Summary: RenderSVGShape invalidates all its resources when it needs layout, but is tha...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-09 21:09 PST by Simon Fraser (smfr)
Modified: 2023-05-14 16:16 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2020-02-09 21:09:25 PST
The MotionMark suits test runs by setting transforms on shapes, which does a layout. This layout invalidates all the RenderSVGShape's resources:

RenderSVGShape::layout():
...
    // Invalidate all resources of this client if our layout changed.
    if (everHadLayout() && selfNeedsLayout())
        SVGResourcesCache::clientLayoutChanged(*this);

but that doesn't seem necessary if the layout doesn't make that resource invalid (e.g. the size doesn't change).

Invalidating resources causes us to rebuild the gradients on every frame, which means making a new platform gradient.
Comment 1 Ahmad Saleem 2023-05-14 16:16:21 PDT
We still have this code:

In LBSE:

https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/RenderSVGShape.cpp#160


    // Invalidate all resources of this client if our layout changed.
    if (everHadLayout() && selfNeedsLayout())
        SVGResourcesCache::clientLayoutChanged(*this);

https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/LegacyRenderSVGShape.cpp#146

// Invalidate all resources of this client if our layout changed.
    if (everHadLayout() && selfNeedsLayout())
        SVGResourcesCache::clientLayoutChanged(*this);

________

Just wanted to share updated bit as of today.