Bug 1321022 pt 2 - Add an array of font variations to gfxFontStyle. r=dholbert
authorJonathan Kew <jkew@mozilla.com>
Sat, 03 Dec 2016 12:18:29 +0000
changeset 325167 e9fadc2e73631344646748400a6419b320c3ed17
parent 325166 c0d84787e5643ab00cf79018e8f80b759b57a95b
child 325168 d97f80b77cb2ce37e9f4e6a2ef527bc399404a78
push id84613
push userjkew@mozilla.com
push dateSat, 03 Dec 2016 12:25:40 +0000
treeherdermozilla-inbound@870d19bb4759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1321022
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1321022 pt 2 - Add an array of font variations to gfxFontStyle. r=dholbert
gfx/thebes/gfxFont.h
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_FONT_H
 #define GFX_FONT_H
 
 #include "gfxTypes.h"
 #include "gfxFontEntry.h"
+#include "gfxFontVariations.h"
 #include "nsString.h"
 #include "gfxPoint.h"
 #include "gfxPattern.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 #include "gfxRect.h"
 #include "nsExpirationTracker.h"
@@ -99,16 +100,19 @@ struct gfxFontStyle {
     // font matching occurs.
 
     // -- list of value tags for specific alternate features
     nsTArray<gfxAlternateValue> alternateValues;
 
     // -- object used to look these up once the font is matched
     RefPtr<gfxFontFeatureValueSet> featureValueLookup;
 
+    // opentype variation settings
+    nsTArray<gfxFontVariation> variationSettings;
+
     // The logical size of the font, in pixels
     gfxFloat size;
 
     // 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;
@@ -204,16 +208,17 @@ struct gfxFontStyle {
             (explicitLanguage == other.explicitLanguage) &&
             (language == other.language) &&
             (baselineOffset == other.baselineOffset) &&
             (*reinterpret_cast<const uint32_t*>(&sizeAdjust) ==
              *reinterpret_cast<const uint32_t*>(&other.sizeAdjust)) &&
             (featureSettings == other.featureSettings) &&
             (alternateValues == other.alternateValues) &&
             (featureValueLookup == other.featureValueLookup) &&
+            (variationSettings == other.variationSettings) &&
             (languageOverride == other.languageOverride);
     }
 
     static void ParseFontFeatureSettings(const nsString& aFeatureString,
                                          nsTArray<gfxFontFeature>& aFeatures);
 
     static uint32_t ParseFontLanguageOverride(const nsString& aLangTag);
 };