[webkit-changes] [WebKit/WebKit] 89e7ad: Avoid churning Style::Colors via colorResolvingCur...
Simon Fraser
noreply at github.com
Thu Dec 19 10:13:05 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 89e7ad2339117000b3ffb81952d59fa58778c614
https://github.com/WebKit/WebKit/commit/89e7ad2339117000b3ffb81952d59fa58778c614
Author: Simon Fraser <simon.fraser at apple.com>
Date: 2024-12-19 (Thu, 19 Dec 2024)
Changed paths:
M Source/WebCore/rendering/style/RenderStyle.cpp
M Source/WebCore/rendering/style/RenderStyle.h
Log Message:
-----------
Avoid churning Style::Colors via colorResolvingCurrentColor()
https://bugs.webkit.org/show_bug.cgi?id=284933
rdar://141729996
Reviewed by Sam Weinig.
~Style::Color shows up on profiles under `RenderStyle::unresolvedColorForProperty()` for painting-heavy tasks
where we often fetch colors to ask about whether something should paint.
`RenderStyle::unresolvedColorForProperty` currently returns a `Style::Color` by value, but we can return by
reference if we handle `CSSPropertyColor` explicitly. `RenderStyle::color()` and `visitedLinkColor()` return
`WebCore::Color` so their `Style::Color` is always a `ResolvedColor`, thus there's no need to hit the `resolveColor()`
code path.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::unresolvedColorForProperty const):
(WebCore::RenderStyle::colorResolvingCurrentColor const):
* Source/WebCore/rendering/style/RenderStyle.h:
Canonical link: https://commits.webkit.org/288099@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list