Shrink some font-related classes and enums
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2018 17:59:29 +0000 (17:59 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2018 17:59:29 +0000 (17:59 +0000)
commite2cb463926424e68b7a19b186090dd24e5c59bdd
treec430cd48b52a0500a2183adf2786b1bfe086aa90
parentabd9bd50c0c45100d4d5e501eb49be0143ef4e2f
Shrink some font-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187686

Reviewed by Myles Maxfield.

Use enum class for enums in TextFlags.h and make them one byte big.

Re-order members of Font to shrink it from 360 to 328 bytes.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
(WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::verticalRightOrientationFont const):
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::offsetToMiddleOfGlyph):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::advancedTextRenderingMode const):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontDescription.cpp:
(WebCore::FontCascadeDescription::FontCascadeDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::setTextRenderingMode):
(WebCore::FontDescription::setOrientation):
(WebCore::FontDescription::setWidthVariant):
(WebCore::FontCascadeDescription::setFontSmoothing):
(WebCore::FontCascadeDescription::initialSmallCaps):
(WebCore::FontCascadeDescription::initialFontSmoothing):
(WebCore::FontCascadeDescription::initialTextRenderingMode):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isForTextCombine const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::showGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash const):
(WebCore::mapFontWidthVariantToCTFeatureSelector):
(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::description const):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::fontFeatures):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/text/TextFlags.h:
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/TextPainter.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::fontAndGlyphOrientation):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/FontCascade.h
Source/WebCore/platform/graphics/FontCascadeFonts.cpp
Source/WebCore/platform/graphics/FontDescription.cpp
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp
Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp
Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
Source/WebCore/platform/graphics/win/FontCGWin.cpp
Source/WebCore/platform/graphics/win/FontCascadeDirect2D.cpp
Source/WebCore/platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp
Source/WebCore/platform/graphics/win/SimpleFontDataDirect2D.cpp
Source/WebCore/platform/text/TextFlags.h
Source/WebCore/rendering/RenderCombineText.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/TextPainter.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/svg/RenderSVGInlineText.cpp