зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1456820 - patch 1 - Reorder fields in nsFont for better packing. r=lsalzman
This commit is contained in:
Родитель
2fffa00bb3
Коммит
4987441d18
|
@ -49,21 +49,45 @@ struct nsFont {
|
||||||
typedef mozilla::FontSlantStyle FontSlantStyle;
|
typedef mozilla::FontSlantStyle FontSlantStyle;
|
||||||
typedef mozilla::FontWeight FontWeight;
|
typedef mozilla::FontWeight FontWeight;
|
||||||
|
|
||||||
// list of font families, either named or generic
|
// List of font families, either named or generic.
|
||||||
|
// This contains a RefPtr and a uint32_t field.
|
||||||
mozilla::FontFamilyList fontlist;
|
mozilla::FontFamilyList fontlist;
|
||||||
|
|
||||||
// Force this font to not be considered a 'generic' font, even if
|
// Font features from CSS font-feature-settings
|
||||||
// the name is the same as a CSS generic font family.
|
nsTArray<gfxFontFeature> fontFeatureSettings;
|
||||||
bool systemFont = false;
|
|
||||||
|
|
||||||
// Variant subproperties
|
// Font variations from CSS font-variation-settings
|
||||||
uint8_t variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
|
nsTArray<gfxFontVariation> fontVariationSettings;
|
||||||
uint8_t variantNumeric = NS_FONT_VARIANT_NUMERIC_NORMAL;
|
|
||||||
uint8_t variantPosition = NS_FONT_VARIANT_POSITION_NORMAL;
|
|
||||||
uint8_t variantWidth = NS_FONT_VARIANT_WIDTH_NORMAL;
|
|
||||||
|
|
||||||
uint16_t variantLigatures = NS_FONT_VARIANT_LIGATURES_NORMAL;
|
// -- list of value tags for font-specific alternate features
|
||||||
uint16_t variantEastAsian = NS_FONT_VARIANT_EAST_ASIAN_NORMAL;
|
nsTArray<gfxAlternateValue> alternateValues;
|
||||||
|
|
||||||
|
// -- object used to look these up once the font is matched
|
||||||
|
RefPtr<gfxFontFeatureValueSet> featureValueLookup;
|
||||||
|
|
||||||
|
// The logical size of the font, in nscoord units
|
||||||
|
nscoord size = 0;
|
||||||
|
|
||||||
|
// The aspect-value (ie., the ratio actualsize:actualxheight) that any
|
||||||
|
// actual physical font created from this font structure must have when
|
||||||
|
// rendering or measuring a string. A value of -1.0 means no adjustment
|
||||||
|
// needs to be done; otherwise the value must be nonnegative.
|
||||||
|
float sizeAdjust = -1.0f;
|
||||||
|
|
||||||
|
// The estimated background color behind the text. Enables a special
|
||||||
|
// rendering mode when NS_GET_A(.) > 0. Only used for text in the chrome.
|
||||||
|
nscolor fontSmoothingBackgroundColor = NS_RGBA(0,0,0,0);
|
||||||
|
|
||||||
|
// Language system tag, to override document language;
|
||||||
|
// this is an OpenType "language system" tag represented as a 32-bit integer
|
||||||
|
// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
|
||||||
|
uint32_t languageOverride = 0;
|
||||||
|
|
||||||
|
// Font-selection/rendering properties corresponding to CSS font-style,
|
||||||
|
// font-weight, font-stretch. These are all 16-bit types.
|
||||||
|
FontSlantStyle style = FontSlantStyle::Normal();
|
||||||
|
FontWeight weight = FontWeight::Normal();
|
||||||
|
FontStretch stretch = FontStretch::Normal();
|
||||||
|
|
||||||
// Some font-variant-alternates property values require
|
// Some font-variant-alternates property values require
|
||||||
// font-specific settings defined via @font-feature-values rules.
|
// font-specific settings defined via @font-feature-values rules.
|
||||||
|
@ -72,17 +96,18 @@ struct nsFont {
|
||||||
// -- bitmask for both enumerated and functional propvals
|
// -- bitmask for both enumerated and functional propvals
|
||||||
uint16_t variantAlternates = NS_FONT_VARIANT_ALTERNATES_NORMAL;
|
uint16_t variantAlternates = NS_FONT_VARIANT_ALTERNATES_NORMAL;
|
||||||
|
|
||||||
|
// Variant subproperties
|
||||||
|
uint16_t variantLigatures = NS_FONT_VARIANT_LIGATURES_NORMAL;
|
||||||
|
uint16_t variantEastAsian = NS_FONT_VARIANT_EAST_ASIAN_NORMAL;
|
||||||
|
|
||||||
|
uint8_t variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
|
||||||
|
uint8_t variantNumeric = NS_FONT_VARIANT_NUMERIC_NORMAL;
|
||||||
|
uint8_t variantPosition = NS_FONT_VARIANT_POSITION_NORMAL;
|
||||||
|
uint8_t variantWidth = NS_FONT_VARIANT_WIDTH_NORMAL;
|
||||||
|
|
||||||
// Smoothing - controls subpixel-antialiasing (currently OSX only)
|
// Smoothing - controls subpixel-antialiasing (currently OSX only)
|
||||||
uint8_t smoothing = NS_FONT_SMOOTHING_AUTO;
|
uint8_t smoothing = NS_FONT_SMOOTHING_AUTO;
|
||||||
|
|
||||||
// The estimated background color behind the text. Enables a special
|
|
||||||
// rendering mode when NS_GET_A(.) > 0. Only used for text in the chrome.
|
|
||||||
nscolor fontSmoothingBackgroundColor = NS_RGBA(0,0,0,0);
|
|
||||||
|
|
||||||
FontSlantStyle style = FontSlantStyle::Normal();
|
|
||||||
FontWeight weight = FontWeight::Normal();
|
|
||||||
FontStretch stretch = FontStretch::Normal();
|
|
||||||
|
|
||||||
// Kerning
|
// Kerning
|
||||||
uint8_t kerning = NS_FONT_KERNING_AUTO;
|
uint8_t kerning = NS_FONT_KERNING_AUTO;
|
||||||
|
|
||||||
|
@ -93,31 +118,9 @@ struct nsFont {
|
||||||
// Synthesis setting, controls use of fake bolding/italics
|
// Synthesis setting, controls use of fake bolding/italics
|
||||||
uint8_t synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
|
uint8_t synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
|
||||||
|
|
||||||
// The logical size of the font, in nscoord units
|
// Force this font to not be considered a 'generic' font, even if
|
||||||
nscoord size = 0;
|
// the name is the same as a CSS generic font family.
|
||||||
|
bool systemFont = false;
|
||||||
// The aspect-value (ie., the ratio actualsize:actualxheight) that any
|
|
||||||
// actual physical font created from this font structure must have when
|
|
||||||
// rendering or measuring a string. A value of -1.0 means no adjustment
|
|
||||||
// needs to be done; otherwise the value must be nonnegative.
|
|
||||||
float sizeAdjust = -1.0f;
|
|
||||||
|
|
||||||
// -- list of value tags for font-specific alternate features
|
|
||||||
nsTArray<gfxAlternateValue> alternateValues;
|
|
||||||
|
|
||||||
// -- object used to look these up once the font is matched
|
|
||||||
RefPtr<gfxFontFeatureValueSet> featureValueLookup;
|
|
||||||
|
|
||||||
// Font features from CSS font-feature-settings
|
|
||||||
nsTArray<gfxFontFeature> fontFeatureSettings;
|
|
||||||
|
|
||||||
// Font variations from CSS font-variation-settings
|
|
||||||
nsTArray<gfxFontVariation> fontVariationSettings;
|
|
||||||
|
|
||||||
// Language system tag, to override document language;
|
|
||||||
// this is an OpenType "language system" tag represented as a 32-bit integer
|
|
||||||
// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
|
|
||||||
uint32_t languageOverride = 0;
|
|
||||||
|
|
||||||
// initialize the font with a fontlist
|
// initialize the font with a fontlist
|
||||||
nsFont(const mozilla::FontFamilyList& aFontlist, nscoord aSize);
|
nsFont(const mozilla::FontFamilyList& aFontlist, nscoord aSize);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче