[webkit-changes] [WebKit/WebKit] 371cab: Avoid copying FontPalette and FontVariantAlternates
Brent Fulgham
noreply at github.com
Fri May 3 17:21:52 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 371cab863ee8cb0010261fddb8e0435391fc4dbd
https://github.com/WebKit/WebKit/commit/371cab863ee8cb0010261fddb8e0435391fc4dbd
Author: Brent Fulgham <bfulgham at apple.com>
Date: 2024-05-03 (Fri, 03 May 2024)
Changed paths:
M Source/WebCore/animation/CSSPropertyAnimation.cpp
M Source/WebCore/platform/graphics/FontDescription.h
M Source/WebCore/platform/text/TextFlags.cpp
M Source/WebCore/platform/text/TextFlags.h
M Source/WebCore/rendering/style/RenderStyle.cpp
M Source/WebCore/rendering/style/RenderStyle.h
M Source/WebCore/rendering/style/RenderStyleInlines.h
M Source/WebCore/style/StyleBuilderCustom.h
Log Message:
-----------
Avoid copying FontPalette and FontVariantAlternates
https://bugs.webkit.org/show_bug.cgi?id=273568
<rdar://problem/127380343>
Reviewed by Chris Dumez.
Reduce unnecessary copies in our font handling code:
(1) FontPalette is a struct containing an enum and an AtomString, and should be returned
by const reference to avoid copying that string.
(2) FontVariantAlternates is lightweight, containing only a `Markable`, but the
`Markable` is holding a very heavy-weight object that contains Vectors of Strings,
and Strings.
* Source/WebCore/css/CSSFontFace.h:
* Source/WebCore/css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::fontFace):
* Source/WebCore/css/CSSFontFaceSet.h:
* Source/WebCore/platform/graphics/FontDescription.h:
(WebCore::FontDescription::variantAlternates const):
(WebCore::FontDescription::fontPalette const):
(WebCore::FontDescription::setVariantAlternates):
(WebCore::FontDescription::setFontPalette):
* Source/WebCore/platform/text/TextFlags.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/text/TextFlags.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontPalette):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::fontPalette const):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontVariantAlternates):
Canonical link: https://commits.webkit.org/278351@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