Bug 235211 - Don't call invalidateRectsForAllMarkers() for every layer in the updateLayerPositions() traversal
Summary: Don't call invalidateRectsForAllMarkers() for every layer in the updateLayerP...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-13 17:00 PST by Simon Fraser (smfr)
Modified: 2022-01-14 11:14 PST (History)
13 users (show)

See Also:


Attachments
Patch (12.63 KB, patch)
2022-01-13 17:02 PST, Simon Fraser (smfr)
zalan: review+
Details | Formatted Diff | Diff
Patch (12.67 KB, patch)
2022-01-13 19:48 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2022-01-13 17:00:01 PST
Don't call invalidateRectsForAllMarkers() for every layer in the updateLayerPositions() traversal
Comment 1 Simon Fraser (smfr) 2022-01-13 17:02:39 PST
Created attachment 449126 [details]
Patch
Comment 2 Sam Weinig 2022-01-13 19:12:49 PST
Comment on attachment 449126 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449126&action=review

> Source/WebCore/rendering/RenderLayer.cpp:942
> +    renderer().document().markers().invalidateRectsForAllMarkers();

Why doesn't this one use willUpdateLayerPositions()?
Comment 3 zalan 2022-01-13 19:28:14 PST
Comment on attachment 449126 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449126&action=review

> Source/WebCore/rendering/RenderLayer.cpp:937
> +    willUpdateLayerPositions();
> +    recursiveUpdateLayerPositions(nullptr, flagsForUpdateLayerPositions(*this));

I don't think I could come up with better names, but these 2 lines will surely confuse me in the future.
Comment 4 Simon Fraser (smfr) 2022-01-13 19:48:15 PST
Created attachment 449130 [details]
Patch
Comment 5 EWS 2022-01-13 22:16:21 PST
Committed r288008 (246034@main): <https://commits.webkit.org/246034@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449130 [details].
Comment 6 Radar WebKit Bug Importer 2022-01-13 22:17:18 PST
<rdar://problem/87587203>
Comment 7 Antti Koivisto 2022-01-14 05:33:13 PST
Comment on attachment 449126 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449126&action=review

> Source/WebCore/rendering/RenderLayer.cpp:1063
> +        child->recursiveUpdateLayerPositions(geometryMap, flags);

could this be something like updateLayerPositionsForSubtree?
Comment 8 Simon Fraser (smfr) 2022-01-14 09:40:16 PST
(In reply to Antti Koivisto from comment #7)
> Comment on attachment 449126 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449126&action=review
> 
> > Source/WebCore/rendering/RenderLayer.cpp:1063
> > +        child->recursiveUpdateLayerPositions(geometryMap, flags);
> 
> could this be something like updateLayerPositionsForSubtree?

It could, but that doesn't make it obvious that it's call recursively.
Comment 9 Antti Koivisto 2022-01-14 10:45:37 PST
> It could, but that doesn't make it obvious that it's call recursively.

Why does that matter? If it was refactored to do the same thing iteratively would the callers care?
Comment 10 Simon Fraser (smfr) 2022-01-14 11:14:25 PST
If it were iterative, I would rename it of course, and the distinction between the "called-once" and the "called-one-per-layer" function wouldn't be necessary.