Diff
Modified: trunk/Source/WebCore/ChangeLog (232174 => 232175)
--- trunk/Source/WebCore/ChangeLog 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/ChangeLog 2018-05-25 00:25:23 UTC (rev 232175)
@@ -1,5 +1,97 @@
2018-05-24 Chris Dumez <cdu...@apple.com>
+ Reduce copying of FontCascadeDescription objects by moving them around
+ https://bugs.webkit.org/show_bug.cgi?id=185963
+
+ Reviewed by Simon Fraser.
+
+ Reduce copying of FontCascadeDescription objects by moving them around when possible.
+
+ * css/StyleBuilderCustom.h:
+ (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
+ (WebCore::StyleBuilderCustom::applyInitialFontFamily):
+ (WebCore::StyleBuilderCustom::applyInheritFontFamily):
+ (WebCore::StyleBuilderCustom::applyValueFontFamily):
+ (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
+ (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
+ (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
+ (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
+ (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
+ (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
+ (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
+ (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
+ (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
+ (WebCore::StyleBuilderCustom::applyInitialFontSize):
+ (WebCore::StyleBuilderCustom::applyInheritFontSize):
+ (WebCore::StyleBuilderCustom::applyInitialFontStyle):
+ (WebCore::StyleBuilderCustom::applyInheritFontStyle):
+ (WebCore::StyleBuilderCustom::applyValueFontStyle):
+ (WebCore::StyleBuilderCustom::applyValueFontSize):
+ * css/StyleResolver.cpp:
+ (WebCore::checkForOrientationChange):
+ (WebCore::StyleResolver::checkForTextSizeAdjust):
+ (WebCore::StyleResolver::checkForZoomChange):
+ (WebCore::StyleResolver::checkForGenericFamilyChange):
+ (WebCore::StyleResolver::initializeFontStyle):
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::State::setFontDescription):
+ (WebCore::StyleResolver::setFontDescription):
+ * css/makeprop.pl:
+ (generateInitialValueSetter):
+ (generateInheritValueSetter):
+ (generateValueSetter):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setFont):
+ * page/DebugPageOverlays.cpp:
+ (WebCore::NonFastScrollableRegionOverlay::drawRect):
+ * page/linux/ResourceUsageOverlayLinux.cpp:
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::FontCascade):
+ * platform/graphics/FontCascade.h:
+ * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+ (PlatformCALayerWin::drawTextAtPoint const):
+ * platform/mock/MockRealtimeVideoSource.cpp:
+ (WebCore::MockRealtimeVideoSource::drawText):
+ * platform/win/DragImageWin.cpp:
+ (WebCore::dragLabelFont):
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenuWin::calculatePositionAndSize):
+ (WebCore::PopupMenuWin::paint):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleDidChange):
+ * rendering/RenderCombineText.cpp:
+ (WebCore::RenderCombineText::combineTextIfNeeded):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
+ * rendering/RenderListBox.cpp:
+ (WebCore::bolder):
+ (WebCore::RenderListBox::paintItemForeground):
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::computeMarkerStyle const):
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::adjustStyle):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::setFontFromControlSize const):
+ * rendering/TextAutoSizing.cpp:
+ (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
+ (WebCore::TextAutoSizingValue::reset):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::setFontDescription):
+ (WebCore::RenderStyle::setFontSize):
+ (WebCore::RenderStyle::setFontVariationSettings):
+ (WebCore::RenderStyle::setFontWeight):
+ (WebCore::RenderStyle::setFontStretch):
+ (WebCore::RenderStyle::setFontItalic):
+ * rendering/style/RenderStyle.h:
+ * rendering/svg/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
+ * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
+ (WebCore::styleForFirstLetter):
+ * style/StyleResolveForDocument.cpp:
+ (WebCore::Style::resolveForDocument):
+
+2018-05-24 Chris Dumez <cdu...@apple.com>
+
Avoid constructing the string "all" repeatedly in MediaQueryParser
https://bugs.webkit.org/show_bug.cgi?id=185961
Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (232174 => 232175)
--- trunk/Source/WebCore/css/StyleBuilderCustom.h 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h 2018-05-25 00:25:23 UTC (rev 232175)
@@ -782,7 +782,7 @@
fontDescription.setLocale(nullAtom());
else
fontDescription.setLocale(primitiveValue.stringValue());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueWritingMode(StyleResolver& styleResolver, CSSValue& value)
@@ -914,7 +914,7 @@
if (!initialDesc.firstFamily().isEmpty())
fontDescription.setFamilies(initialDesc.families());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInheritFontFamily(StyleResolver& styleResolver)
@@ -924,7 +924,7 @@
fontDescription.setFamilies(parentFontDescription.families());
fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontFamily(StyleResolver& styleResolver, CSSValue& value)
@@ -1001,7 +1001,7 @@
styleResolver.setFontSize(fontDescription, Style::fontSizeForKeyword(sizeIdentifier, !oldFamilyUsedFixedDefaultSize, styleResolver.document()));
}
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline bool StyleBuilderCustom::isValidDisplayValue(StyleResolver& styleResolver, EDisplay display)
@@ -1468,7 +1468,7 @@
fontDescription.setVariantDiscretionaryLigatures(styleResolver.parentFontDescription().variantDiscretionaryLigatures());
fontDescription.setVariantHistoricalLigatures(styleResolver.parentFontDescription().variantHistoricalLigatures());
fontDescription.setVariantContextualAlternates(styleResolver.parentFontDescription().variantContextualAlternates());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInitialFontVariantLigatures(StyleResolver& styleResolver)
@@ -1478,7 +1478,7 @@
fontDescription.setVariantDiscretionaryLigatures(FontVariantLigatures::Normal);
fontDescription.setVariantHistoricalLigatures(FontVariantLigatures::Normal);
fontDescription.setVariantContextualAlternates(FontVariantLigatures::Normal);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontVariantLigatures(StyleResolver& styleResolver, CSSValue& value)
@@ -1489,7 +1489,7 @@
fontDescription.setVariantDiscretionaryLigatures(variantLigatures.discretionaryLigatures);
fontDescription.setVariantHistoricalLigatures(variantLigatures.historicalLigatures);
fontDescription.setVariantContextualAlternates(variantLigatures.contextualAlternates);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInheritFontVariantNumeric(StyleResolver& styleResolver)
@@ -1500,7 +1500,7 @@
fontDescription.setVariantNumericFraction(styleResolver.parentFontDescription().variantNumericFraction());
fontDescription.setVariantNumericOrdinal(styleResolver.parentFontDescription().variantNumericOrdinal());
fontDescription.setVariantNumericSlashedZero(styleResolver.parentFontDescription().variantNumericSlashedZero());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInitialFontVariantNumeric(StyleResolver& styleResolver)
@@ -1511,7 +1511,7 @@
fontDescription.setVariantNumericFraction(FontVariantNumericFraction::Normal);
fontDescription.setVariantNumericOrdinal(FontVariantNumericOrdinal::Normal);
fontDescription.setVariantNumericSlashedZero(FontVariantNumericSlashedZero::Normal);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontVariantNumeric(StyleResolver& styleResolver, CSSValue& value)
@@ -1523,7 +1523,7 @@
fontDescription.setVariantNumericFraction(variantNumeric.fraction);
fontDescription.setVariantNumericOrdinal(variantNumeric.ordinal);
fontDescription.setVariantNumericSlashedZero(variantNumeric.slashedZero);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInheritFontVariantEastAsian(StyleResolver& styleResolver)
@@ -1532,7 +1532,7 @@
fontDescription.setVariantEastAsianVariant(styleResolver.parentFontDescription().variantEastAsianVariant());
fontDescription.setVariantEastAsianWidth(styleResolver.parentFontDescription().variantEastAsianWidth());
fontDescription.setVariantEastAsianRuby(styleResolver.parentFontDescription().variantEastAsianRuby());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInitialFontVariantEastAsian(StyleResolver& styleResolver)
@@ -1541,7 +1541,7 @@
fontDescription.setVariantEastAsianVariant(FontVariantEastAsianVariant::Normal);
fontDescription.setVariantEastAsianWidth(FontVariantEastAsianWidth::Normal);
fontDescription.setVariantEastAsianRuby(FontVariantEastAsianRuby::Normal);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontVariantEastAsian(StyleResolver& styleResolver, CSSValue& value)
@@ -1551,7 +1551,7 @@
fontDescription.setVariantEastAsianVariant(variantEastAsian.variant);
fontDescription.setVariantEastAsianWidth(variantEastAsian.width);
fontDescription.setVariantEastAsianRuby(variantEastAsian.ruby);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInitialFontSize(StyleResolver& styleResolver)
@@ -1564,7 +1564,7 @@
fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
styleResolver.setFontSize(fontDescription, size);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInheritFontSize(StyleResolver& styleResolver)
@@ -1578,7 +1578,7 @@
auto fontDescription = styleResolver.style()->fontDescription();
fontDescription.setKeywordSize(parentFontDescription.keywordSize());
styleResolver.setFontSize(fontDescription, size);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
// When the CSS keyword "larger" is used, this function will attempt to match within the keyword
@@ -1620,7 +1620,7 @@
auto fontDescription = styleResolver.fontDescription();
fontDescription.setItalic(FontCascadeDescription::initialItalic());
fontDescription.setFontStyleAxis(FontCascadeDescription::initialFontStyleAxis());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInheritFontStyle(StyleResolver& styleResolver)
@@ -1628,7 +1628,7 @@
auto fontDescription = styleResolver.fontDescription();
fontDescription.setItalic(styleResolver.parentFontDescription().italic());
fontDescription.setFontStyleAxis(styleResolver.parentFontDescription().fontStyleAxis());
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontStyle(StyleResolver& styleResolver, CSSValue& value)
@@ -1637,7 +1637,7 @@
auto fontDescription = styleResolver.fontDescription();
fontDescription.setItalic(StyleBuilderConverter::convertFontStyleFromValue(fontStyleValue));
fontDescription.setFontStyleAxis(fontStyleValue.fontStyleValue->valueID() == CSSValueItalic ? FontStyleAxis::ital : FontStyleAxis::slnt);
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyValueFontSize(StyleResolver& styleResolver, CSSValue& value)
@@ -1701,7 +1701,7 @@
return;
styleResolver.setFontSize(fontDescription, std::min(maximumAllowedFontSize, size));
- styleResolver.setFontDescription(fontDescription);
+ styleResolver.setFontDescription(WTFMove(fontDescription));
}
inline void StyleBuilderCustom::applyInitialGridTemplateAreas(StyleResolver& styleResolver)
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (232174 => 232175)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -1089,7 +1089,7 @@
auto newFontDescription = fontDescription;
newFontDescription.setNonCJKGlyphOrientation(glyphOrientation);
newFontDescription.setOrientation(fontOrientation);
- style->setFontDescription(newFontDescription);
+ style->setFontDescription(WTFMove(newFontDescription));
}
void StyleResolver::updateFont()
@@ -1736,7 +1736,7 @@
newFontDescription.setComputedSize(newFontDescription.specifiedSize() * style->textSizeAdjust().multiplier());
else
newFontDescription.setComputedSize(newFontDescription.specifiedSize());
- style->setFontDescription(newFontDescription);
+ style->setFontDescription(WTFMove(newFontDescription));
}
#endif
@@ -1751,7 +1751,7 @@
const auto& childFont = style->fontDescription();
auto newFontDescription = childFont;
setFontSize(newFontDescription, childFont.specifiedSize());
- style->setFontDescription(newFontDescription);
+ style->setFontDescription(WTFMove(newFontDescription));
}
void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const RenderStyle* parentStyle)
@@ -1782,7 +1782,7 @@
auto newFontDescription = childFont;
setFontSize(newFontDescription, size);
- style->setFontDescription(newFontDescription);
+ style->setFontDescription(WTFMove(newFontDescription));
}
void StyleResolver::initializeFontStyle()
@@ -1793,7 +1793,7 @@
fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
fontDescription.setShouldAllowUserInstalledFonts(settings().shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No);
- setFontDescription(fontDescription);
+ setFontDescription(WTFMove(fontDescription));
}
void StyleResolver::setFontSize(FontCascadeDescription& fontDescription, float size)
Modified: trunk/Source/WebCore/css/StyleResolver.h (232174 => 232175)
--- trunk/Source/WebCore/css/StyleResolver.h 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/css/StyleResolver.h 2018-05-25 00:25:23 UTC (rev 232175)
@@ -377,7 +377,7 @@
const FontCascadeDescription& fontDescription() { return m_style->fontDescription(); }
const FontCascadeDescription& parentFontDescription() { return m_parentStyle->fontDescription(); }
- void setFontDescription(const FontCascadeDescription& fontDescription) { m_fontDirty |= m_style->setFontDescription(fontDescription); }
+ void setFontDescription(FontCascadeDescription&& fontDescription) { m_fontDirty |= m_style->setFontDescription(WTFMove(fontDescription)); }
void setZoom(float f) { m_fontDirty |= m_style->setZoom(f); }
void setEffectiveZoom(float f) { m_fontDirty |= m_style->setEffectiveZoom(f); }
void setWritingMode(WritingMode writingMode) { m_fontDirty |= m_style->setWritingMode(writingMode); }
@@ -448,7 +448,7 @@
InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; }
const FontCascadeDescription& fontDescription() { return m_state.fontDescription(); }
const FontCascadeDescription& parentFontDescription() { return m_state.parentFontDescription(); }
- void setFontDescription(const FontCascadeDescription& fontDescription) { m_state.setFontDescription(fontDescription); }
+ void setFontDescription(FontCascadeDescription&& fontDescription) { m_state.setFontDescription(WTFMove(fontDescription)); }
void setZoom(float f) { m_state.setZoom(f); }
void setEffectiveZoom(float f) { m_state.setEffectiveZoom(f); }
void setWritingMode(WritingMode writingMode) { m_state.setWritingMode(writingMode); }
Modified: trunk/Source/WebCore/css/makeprop.pl (232174 => 232175)
--- trunk/Source/WebCore/css/makeprop.pl 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/css/makeprop.pl 2018-05-25 00:25:23 UTC (rev 232175)
@@ -853,7 +853,7 @@
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) {
$setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n";
$setterContent .= $indent . " fontDescription." . $setter . "(FontCascadeDescription::" . $initial . "());\n";
- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n";
+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n";
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) {
$setterContent .= generateFillLayerPropertyInitialValueSetter($name, $indent . " ");
} else {
@@ -897,7 +897,7 @@
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) {
$setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n";
$setterContent .= $indent . " fontDescription." . $setter . "(styleResolver.parentFontDescription()." . $getter . "());\n";
- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n";
+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n";
$didCallSetValue = 1;
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) {
$setterContent .= generateFillLayerPropertyInheritValueSetter($name, $indent . " ");
@@ -951,7 +951,7 @@
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"font-property"}) {
$setterContent .= $indent . " auto fontDescription = styleResolver.fontDescription();\n";
$setterContent .= $indent . " fontDescription." . $setter . "(" . $convertedValue . ");\n";
- $setterContent .= $indent . " styleResolver.setFontDescription(fontDescription);\n";
+ $setterContent .= $indent . " styleResolver.setFontDescription(WTFMove(fontDescription));\n";
$didCallSetValue = 1;
} elsif (exists $propertiesWithStyleBuilderOptions{$name}{"fill-layer-property"}) {
$setterContent .= generateFillLayerPropertyValueSetter($name, $indent . " ");
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (232174 => 232175)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -150,7 +150,7 @@
document.updateStyleIfNeeded();
if (auto* computedStyle = canvas().computedStyle())
- newStyle->setFontDescription(computedStyle->fontDescription());
+ newStyle->setFontDescription(FontCascadeDescription { computedStyle->fontDescription() });
else {
FontCascadeDescription defaultFontDescription;
defaultFontDescription.setOneFamily(DefaultFontFamily);
@@ -157,7 +157,7 @@
defaultFontDescription.setSpecifiedSize(DefaultFontSize);
defaultFontDescription.setComputedSize(DefaultFontSize);
- newStyle->setFontDescription(defaultFontDescription);
+ newStyle->setFontDescription(WTFMove(defaultFontDescription));
}
newStyle->fontCascade().update(&document.fontSelector());
Modified: trunk/Source/WebCore/page/DebugPageOverlays.cpp (232174 => 232175)
--- trunk/Source/WebCore/page/DebugPageOverlays.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/page/DebugPageOverlays.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -189,7 +189,7 @@
fontDescription.setSpecifiedSize(12);
fontDescription.setComputedSize(12);
fontDescription.setWeight(FontSelectionValue(500));
- FontCascade font(fontDescription, 0, 0);
+ FontCascade font(WTFMove(fontDescription), 0, 0);
font.update(nullptr);
#if ENABLE(TOUCH_EVENTS)
Modified: trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp (232174 => 232175)
--- trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -76,7 +76,7 @@
FontCascadeDescription fontDescription;
RenderTheme::singleton().systemFont(CSSValueMessageBox, fontDescription);
fontDescription.setComputedSize(gFontSize);
- m_textFont = FontCascade(fontDescription, 0, 0);
+ m_textFont = FontCascade(WTFMove(fontDescription), 0, 0);
m_textFont.update(nullptr);
}
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (232174 => 232175)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -77,11 +77,11 @@
{
}
-FontCascade::FontCascade(const FontCascadeDescription& fd, float letterSpacing, float wordSpacing)
- : m_fontDescription(fd)
+FontCascade::FontCascade(FontCascadeDescription&& fd, float letterSpacing, float wordSpacing)
+ : m_fontDescription(WTFMove(fd))
, m_letterSpacing(letterSpacing)
, m_wordSpacing(wordSpacing)
- , m_useBackslashAsYenSymbol(useBackslashAsYenSignForFamily(fd.firstFamily()))
+ , m_useBackslashAsYenSymbol(useBackslashAsYenSignForFamily(m_fontDescription.firstFamily()))
, m_enableKerning(computeEnableKerning())
, m_requiresShaping(computeRequiresShaping())
{
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (232174 => 232175)
--- trunk/Source/WebCore/platform/graphics/FontCascade.h 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h 2018-05-25 00:25:23 UTC (rev 232175)
@@ -101,7 +101,7 @@
class FontCascade {
public:
WEBCORE_EXPORT FontCascade();
- WEBCORE_EXPORT FontCascade(const FontCascadeDescription&, float letterSpacing = 0, float wordSpacing = 0);
+ WEBCORE_EXPORT FontCascade(FontCascadeDescription&&, float letterSpacing = 0, float wordSpacing = 0);
// This constructor is only used if the platform wants to start with a native font.
WEBCORE_EXPORT FontCascade(const FontPlatformData&, FontSmoothingMode = AutoSmoothing);
Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (232174 => 232175)
--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -963,7 +963,7 @@
desc.setComputedSize(scale.width * fontSize);
- FontCascade font = FontCascade(desc, 0, 0);
+ FontCascade font = FontCascade(WTFMove(desc), 0, 0);
font.update(nullptr);
GraphicsContext cg(context);
Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (232174 => 232175)
--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -336,17 +336,17 @@
fontDescription.setSpecifiedSize(m_baseFontSize);
fontDescription.setComputedSize(m_baseFontSize);
- FontCascade timeFont { fontDescription, 0, 0 };
+ FontCascade timeFont { FontCascadeDescription { fontDescription }, 0, 0 };
timeFont.update(nullptr);
fontDescription.setSpecifiedSize(m_bipBopFontSize);
fontDescription.setComputedSize(m_bipBopFontSize);
- FontCascade bipBopFont { fontDescription, 0, 0 };
+ FontCascade bipBopFont { FontCascadeDescription { fontDescription }, 0, 0 };
bipBopFont.update(nullptr);
fontDescription.setSpecifiedSize(m_statsFontSize);
fontDescription.setComputedSize(m_statsFontSize);
- FontCascade statsFont { fontDescription, 0, 0 };
+ FontCascade statsFont { WTFMove(fontDescription), 0, 0 };
statsFont.update(nullptr);
IntSize size = this->size();
Modified: trunk/Source/WebCore/platform/win/DragImageWin.cpp (232174 => 232175)
--- trunk/Source/WebCore/platform/win/DragImageWin.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/win/DragImageWin.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -116,7 +116,7 @@
description.setSpecifiedSize((float)size);
description.setComputedSize((float)size);
description.setRenderingMode(renderingMode);
- result = FontCascade(description, 0, 0);
+ result = FontCascade(WTFMove(description), 0, 0);
result.update(0);
return result;
}
Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.cpp (232174 => 232175)
--- trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -322,7 +322,7 @@
m_font = client()->menuStyle().font();
auto d = m_font.fontDescription();
d.setComputedSize(d.computedSize() * m_scaleFactor);
- m_font = FontCascade(d, m_font.letterSpacing(), m_font.wordSpacing());
+ m_font = FontCascade(WTFMove(d), m_font.letterSpacing(), m_font.wordSpacing());
m_font.update(m_popupClient->fontSelector());
// First, determine the popup's height
@@ -345,7 +345,7 @@
if (client()->itemIsLabel(i)) {
auto d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
- itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing());
+ itemFont = FontCascade(WTFMove(d), itemFont.letterSpacing(), itemFont.wordSpacing());
itemFont.update(m_popupClient->fontSelector());
}
@@ -650,7 +650,7 @@
if (client()->itemIsLabel(index)) {
auto d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
- itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing());
+ itemFont = FontCascade(WTFMove(d), itemFont.letterSpacing(), itemFont.wordSpacing());
itemFont.update(m_popupClient->fontSelector());
}
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -392,7 +392,7 @@
// Propagate the body font back up to the RenderView and use it as
// the basis of the grid.
if (newStyle.fontDescription() != view().style().fontDescription()) {
- view().mutableStyle().setFontDescription(newStyle.fontDescription());
+ view().mutableStyle().setFontDescription(FontCascadeDescription { newStyle.fontDescription() });
view().mutableStyle().fontCascade().update(&document().fontSelector());
}
}
Modified: trunk/Source/WebCore/rendering/RenderCombineText.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderCombineText.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderCombineText.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -124,7 +124,7 @@
description.setOrientation(Horizontal); // We are going to draw combined text horizontally.
- FontCascade horizontalFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
+ FontCascade horizontalFont(FontCascadeDescription { description }, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
horizontalFont.update(fontSelector);
GlyphOverflow glyphOverflow;
@@ -137,7 +137,7 @@
m_isCombined = combinedTextWidth <= emWidth;
if (m_isCombined)
- shouldUpdateFont = m_combineFontStyle->setFontDescription(description); // Need to change font orientation to horizontal.
+ shouldUpdateFont = m_combineFontStyle->setFontDescription(WTFMove(description)); // Need to change font orientation to horizontal.
else {
// Need to try compressed glyphs.
static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth };
@@ -144,7 +144,7 @@
for (auto widthVariant : widthVariants) {
description.setWidthVariant(widthVariant); // When modifying this, make sure to keep it in sync with FontPlatformData::isForTextCombine()!
- FontCascade compressedFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
+ FontCascade compressedFont(FontCascadeDescription { description }, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
compressedFont.update(fontSelector);
glyphOverflow.left = glyphOverflow.top = glyphOverflow.right = glyphOverflow.bottom = 0;
@@ -154,7 +154,7 @@
m_isCombined = true;
// Replace my font with the new one.
- shouldUpdateFont = m_combineFontStyle->setFontDescription(description);
+ shouldUpdateFont = m_combineFontStyle->setFontDescription(WTFMove(description));
break;
}
@@ -172,9 +172,9 @@
do {
float computedSize = originalSize * scaleFactor;
bestFitDescription.setComputedSize(computedSize);
- shouldUpdateFont = m_combineFontStyle->setFontDescription(bestFitDescription);
+ shouldUpdateFont = m_combineFontStyle->setFontDescription(FontCascadeDescription { bestFitDescription });
- FontCascade compressedFont(bestFitDescription, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
+ FontCascade compressedFont(WTFMove(bestFitDescription), style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
compressedFont.update(fontSelector);
glyphOverflow.left = glyphOverflow.top = glyphOverflow.right = glyphOverflow.bottom = 0;
Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -378,7 +378,7 @@
fontDescription.setWeight(boldWeightValue());
fontDescription.setRenderingMode(settings().fontRenderingMode());
fontDescription.setComputedSize(12);
- font = FontCascade(fontDescription, 0, 0);
+ font = FontCascade(WTFMove(fontDescription), 0, 0);
font.update(0);
run = TextRun(m_unavailablePluginReplacementText);
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -120,7 +120,7 @@
{
auto description = font.fontDescription();
description.setWeight(description.bolderWeight());
- auto result = FontCascade { description, font.letterSpacing(), font.wordSpacing() };
+ auto result = FontCascade { WTFMove(description), font.letterSpacing(), font.wordSpacing() };
result.update(&document.fontSelector());
return result;
}
@@ -441,7 +441,7 @@
if (is<HTMLOptGroupElement>(*listItemElement)) {
auto description = itemFont.fontDescription();
description.setWeight(description.bolderWeight());
- itemFont = FontCascade(description, itemFont.letterSpacing(), itemFont.wordSpacing());
+ itemFont = FontCascade(WTFMove(description), itemFont.letterSpacing(), itemFont.wordSpacing());
itemFont.update(&document().fontSelector());
}
Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderListItem.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -69,7 +69,7 @@
RenderStyle parentStyle = RenderStyle::clone(style());
auto fontDescription = style().fontDescription();
fontDescription.setVariantNumericSpacing(FontVariantNumericSpacing::TabularNumbers);
- parentStyle.setFontDescription(fontDescription);
+ parentStyle.setFontDescription(WTFMove(fontDescription));
parentStyle.fontCascade().update(&document().fontSelector());
if (auto markerStyle = getCachedPseudoStyle(MARKER, &parentStyle))
return RenderStyle::clone(*markerStyle);
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -176,7 +176,7 @@
if (auto themeFont = Theme::singleton().controlFont(part, style.fontCascade(), style.effectiveZoom())) {
// If overriding the specified font with the theme font, also override the line height with the standard line height.
style.setLineHeight(RenderStyle::initialLineHeight());
- if (style.setFontDescription(themeFont.value()))
+ if (style.setFontDescription(WTFMove(themeFont.value())))
style.fontCascade().update(nullptr);
}
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (232174 => 232175)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2018-05-25 00:25:23 UTC (rev 232175)
@@ -791,7 +791,7 @@
// Reset line height
style.setLineHeight(RenderStyle::initialLineHeight());
- if (style.setFontDescription(fontDescription))
+ if (style.setFontDescription(WTFMove(fontDescription)))
style.fontCascade().update(0);
}
Modified: trunk/Source/WebCore/rendering/TextAutoSizing.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/TextAutoSizing.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -122,7 +122,7 @@
auto style = cloneRenderStyleWithState(renderer.style());
auto fontDescription = style.fontDescription();
fontDescription.setComputedSize(averageSize);
- style.setFontDescription(fontDescription);
+ style.setFontDescription(FontCascadeDescription { fontDescription });
style.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(style));
@@ -133,7 +133,7 @@
if (is<RenderListMarker>(*parentRenderer->firstChild())) {
auto& listMarkerRenderer = downcast<RenderListMarker>(*parentRenderer->firstChild());
auto style = cloneRenderStyleWithState(listMarkerRenderer.style());
- style.setFontDescription(fontDescription);
+ style.setFontDescription(FontCascadeDescription { fontDescription });
style.fontCascade().update(&node->document().fontSelector());
listMarkerRenderer.setStyle(WTFMove(style));
}
@@ -156,7 +156,7 @@
auto newParentStyle = cloneRenderStyleWithState(parentStyle);
newParentStyle.setLineHeight(Length(lineHeight, Fixed));
newParentStyle.setSpecifiedLineHeight(Length { lineHeightLength });
- newParentStyle.setFontDescription(fontDescription);
+ newParentStyle.setFontDescription(WTFMove(fontDescription));
newParentStyle.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(newParentStyle));
@@ -198,7 +198,7 @@
if (fontDescription.computedSize() != originalSize) {
fontDescription.setComputedSize(originalSize);
auto style = cloneRenderStyleWithState(renderer->style());
- style.setFontDescription(fontDescription);
+ style.setFontDescription(FontCascadeDescription { fontDescription });
style.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(style));
}
@@ -214,7 +214,7 @@
auto newParentStyle = cloneRenderStyleWithState(parentStyle);
newParentStyle.setLineHeight(Length { originalLineHeight });
- newParentStyle.setFontDescription(fontDescription);
+ newParentStyle.setFontDescription(WTFMove(fontDescription));
newParentStyle.fontCascade().update(&node->document().fontSelector());
parentRenderer->setStyle(WTFMove(newParentStyle));
}
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -1548,12 +1548,12 @@
return m_inheritedData->fontCascade.letterSpacing();
}
-bool RenderStyle::setFontDescription(const FontCascadeDescription& description)
+bool RenderStyle::setFontDescription(FontCascadeDescription&& description)
{
if (m_inheritedData->fontCascade.fontDescription() == description)
return false;
auto& cascade = m_inheritedData.access().fontCascade;
- cascade = { description, cascade.letterSpacing(), cascade.wordSpacing() };
+ cascade = { WTFMove(description), cascade.letterSpacing(), cascade.wordSpacing() };
return true;
}
@@ -1642,7 +1642,7 @@
description.setSpecifiedSize(size);
description.setComputedSize(size);
- setFontDescription(description);
+ setFontDescription(WTFMove(description));
fontCascade().update(currentFontSelector);
}
@@ -1653,7 +1653,7 @@
auto description = fontDescription();
description.setVariationSettings(WTFMove(settings));
- setFontDescription(description);
+ setFontDescription(WTFMove(description));
fontCascade().update(currentFontSelector);
}
#endif
@@ -1664,7 +1664,7 @@
auto description = fontDescription();
description.setWeight(value);
- setFontDescription(description);
+ setFontDescription(WTFMove(description));
fontCascade().update(currentFontSelector);
}
@@ -1674,7 +1674,7 @@
auto description = fontDescription();
description.setStretch(value);
- setFontDescription(description);
+ setFontDescription(WTFMove(description));
fontCascade().update(currentFontSelector);
}
@@ -1684,7 +1684,7 @@
auto description = fontDescription();
description.setItalic(value);
- setFontDescription(description);
+ setFontDescription(WTFMove(description));
fontCascade().update(currentFontSelector);
}
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (232174 => 232175)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2018-05-25 00:25:23 UTC (rev 232175)
@@ -899,7 +899,7 @@
void setClear(Clear v) { m_nonInheritedFlags.clear = static_cast<unsigned>(v); }
void setTableLayout(TableLayoutType v) { m_nonInheritedFlags.tableLayout = static_cast<unsigned>(v); }
- bool setFontDescription(const FontCascadeDescription&);
+ bool setFontDescription(FontCascadeDescription&&);
// Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
void setFontSize(float);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -247,7 +247,7 @@
if (fontDescription.orientation() != FontOrientation::Horizontal)
fontDescription.setOrientation(FontOrientation::Horizontal);
- scaledFont = FontCascade(fontDescription, 0, 0);
+ scaledFont = FontCascade(WTFMove(fontDescription), 0, 0);
scaledFont.update(&renderer.document().fontSelector());
}
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp (232174 => 232175)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -66,7 +66,7 @@
float startingFontSize = ((firstLetterStyle.initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight()) / capRatio;
newFontDescription.setSpecifiedSize(startingFontSize);
newFontDescription.setComputedSize(startingFontSize);
- firstLetterStyle.setFontDescription(newFontDescription);
+ firstLetterStyle.setFontDescription(WTFMove(newFontDescription));
firstLetterStyle.fontCascade().update(firstLetterStyle.fontCascade().fontSelector());
int desiredCapHeight = (firstLetterStyle.initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight();
@@ -75,7 +75,7 @@
auto newFontDescription = firstLetterStyle.fontDescription();
newFontDescription.setSpecifiedSize(newFontDescription.specifiedSize() - 1);
newFontDescription.setComputedSize(newFontDescription.computedSize() -1);
- firstLetterStyle.setFontDescription(newFontDescription);
+ firstLetterStyle.setFontDescription(WTFMove(newFontDescription));
firstLetterStyle.fontCascade().update(firstLetterStyle.fontCascade().fontSelector());
actualCapHeight = firstLetterStyle.fontMetrics().capHeight();
}
Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (232174 => 232175)
--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -123,7 +123,7 @@
fontDescription.setOrientation(fontOrientation);
fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
- documentStyle.setFontDescription(fontDescription);
+ documentStyle.setFontDescription(WTFMove(fontDescription));
documentStyle.fontCascade().update(&const_cast<Document&>(document).fontSelector());
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (232174 => 232175)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2018-05-25 00:25:23 UTC (rev 232175)
@@ -1,3 +1,15 @@
+2018-05-24 Chris Dumez <cdu...@apple.com>
+
+ Reduce copying of FontCascadeDescription objects by moving them around
+ https://bugs.webkit.org/show_bug.cgi?id=185963
+
+ Reviewed by Simon Fraser.
+
+ Reduce copying of FontCascadeDescription objects by moving them around when possible.
+
+ * FullscreenVideoController.cpp:
+ (FullscreenVideoController::draw):
+
2018-05-15 Antoine Quint <grao...@apple.com>
[Web Animations] Expose Web Animations CSS integration as an experimental feature
Modified: trunk/Source/WebKitLegacy/win/FullscreenVideoController.cpp (232174 => 232175)
--- trunk/Source/WebKitLegacy/win/FullscreenVideoController.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Source/WebKitLegacy/win/FullscreenVideoController.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -520,7 +520,7 @@
desc.setOneFamily(metrics.lfSmCaptionFont.lfFaceName);
desc.setComputedSize(textSize);
- FontCascade font = FontCascade(desc, 0, 0);
+ FontCascade font = FontCascade(WTFMove(desc), 0, 0);
font.update(0);
String s;
Modified: trunk/Tools/ChangeLog (232174 => 232175)
--- trunk/Tools/ChangeLog 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Tools/ChangeLog 2018-05-25 00:25:23 UTC (rev 232175)
@@ -1,3 +1,15 @@
+2018-05-24 Chris Dumez <cdu...@apple.com>
+
+ Reduce copying of FontCascadeDescription objects by moving them around
+ https://bugs.webkit.org/show_bug.cgi?id=185963
+
+ Reviewed by Simon Fraser.
+
+ Reduce copying of FontCascadeDescription objects by moving them around when possible.
+
+ * TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
+ (TestWebKitAPI::TEST_F):
+
2018-05-24 Carlos Garcia Campos <cgar...@igalia.com>
WebDriver: implement maximize, minimize and fullscreen window commands
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp (232174 => 232175)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp 2018-05-25 00:13:30 UTC (rev 232174)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp 2018-05-25 00:25:23 UTC (rev 232175)
@@ -49,7 +49,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(80);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
auto spaceWidth = font.primaryFont().spaceWidth();
@@ -96,7 +96,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(80);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
Vector<FloatSize> advances = { FloatSize(), FloatSize(21.640625, 0.0), FloatSize(42.3046875, 0.0), FloatSize(55.8984375, 0.0), FloatSize(22.34375, 0.0) };
@@ -140,7 +140,7 @@
FontCascadeDescription description;
description.setOneFamily("LucidaGrande");
description.setComputedSize(80);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
auto spaceWidth = font.primaryFont().spaceWidth();
@@ -183,7 +183,7 @@
FontCascadeDescription description;
description.setOneFamily("LucidaGrande");
description.setComputedSize(80);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
Vector<FloatSize> advances = { FloatSize(76.347656, 0.000000), FloatSize(0.000000, 0.000000) };
@@ -220,7 +220,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(48);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
FloatSize initialAdvance = FloatSize(4.33996383363472, 12.368896925859);
@@ -266,7 +266,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(48);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
UChar characters[] = { 'a' };
@@ -296,7 +296,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(48);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
UChar characters[] = { 'a', 'b', 'c', 'd' };
@@ -340,7 +340,7 @@
FontCascadeDescription description;
description.setOneFamily("Times");
description.setComputedSize(80);
- FontCascade font(description);
+ FontCascade font(WTFMove(description));
font.update();
Vector<FloatSize> advances = { FloatSize(1, 0), FloatSize(2, 0), FloatSize(4, 0), FloatSize(8, 0), FloatSize(16, 0) };