Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1376)

Unified Diff: third_party/WebKit/Source/platform/fonts/FontDescription.cpp

Issue 2581083003: Initial OpenType Font Variations Support (Closed)
Patch Set: Fix hash collision tests, adjust test expectations Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/FontDescription.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
index f0012be0fcaa86e9ca0b66a52250b1af3a34eecd..b8c4da4b2f2a63b16a2ba2547c7adfcb0bc34709 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -224,7 +224,8 @@ FontCacheKey FontDescription::cacheKey(
static_cast<unsigned>(m_fields.m_subpixelTextPosition); // bit 1
return FontCacheKey(creationParams, effectiveFontSize(),
- options | fontTraits.bitfield() << 8);
+ options | fontTraits.bitfield() << 8,
+ m_variationSettings);
}
void FontDescription::setDefaultTypesettingFeatures(
@@ -311,16 +312,9 @@ unsigned FontDescription::styleHashWithoutFamilyList() const {
addToHash(hash, settings->at(i).value());
}
}
- const FontVariationSettings* varSettings = variationSettings();
- if (varSettings) {
- unsigned numFeatures = varSettings->size();
- for (unsigned i = 0; i < numFeatures; ++i) {
- const AtomicString& tag = varSettings->at(i).tag();
- for (unsigned j = 0; j < tag.length(); j++)
- stringHasher.addCharacter(tag[j]);
- addToHash(hash, varSettings->at(i).value());
- }
- }
+
+ if (variationSettings())
+ addToHash(hash, variationSettings()->hash());
if (m_locale) {
const AtomicString& locale = m_locale->localeString();

Powered by Google App Engine
This is Rietveld 408576698