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

Unified Diff: Source/platform/fonts/FontCacheKey.h

Issue 307243002: Fix font family based fallback font selection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Windows link fix. Created 6 years, 6 months 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
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontCacheKey.h
diff --git a/Source/platform/fonts/FontCacheKey.h b/Source/platform/fonts/FontCacheKey.h
index 8376e8d9e755d6cd7d28c55c7287458d3c11ac9a..a070eff7980afd87491a001279ae18843da55092 100644
--- a/Source/platform/fonts/FontCacheKey.h
+++ b/Source/platform/fonts/FontCacheKey.h
@@ -31,6 +31,7 @@
#ifndef FontCacheKey_h
#define FontCacheKey_h
+#include "FontFaceCreationParams.h"
#include "wtf/HashMap.h"
#include "wtf/HashTableDeletedValueType.h"
#include "wtf/text/AtomicStringHash.h"
@@ -46,11 +47,11 @@ struct FontCacheKey {
WTF_MAKE_FAST_ALLOCATED;
public:
FontCacheKey()
- : m_familyName()
+ : m_creationParams()
, m_fontSize(0)
, m_options(0) { }
- FontCacheKey(AtomicString familyName, float fontSize, unsigned options)
- : m_familyName(familyName)
+ FontCacheKey(FontFaceCreationParams creationParams, float fontSize, unsigned options)
+ : m_creationParams(creationParams)
, m_fontSize(fontSize * s_fontSizePrecisionMultiplier)
, m_options(options) { }
FontCacheKey(WTF::HashTableDeletedValueType)
@@ -59,7 +60,7 @@ public:
unsigned hash() const
{
unsigned hashCodes[3] = {
- CaseFoldingHash::hash(m_familyName),
+ m_creationParams.hash(),
m_fontSize,
m_options
};
@@ -68,7 +69,7 @@ public:
bool operator==(const FontCacheKey& other) const
{
- return equalIgnoringCase(m_familyName, other.m_familyName)
+ return m_creationParams == other.m_creationParams
&& m_fontSize == other.m_fontSize
&& m_options == other.m_options;
}
@@ -89,7 +90,7 @@ private:
return 0xFFFFFFFFU;
}
- AtomicString m_familyName;
+ FontFaceCreationParams m_creationParams;
unsigned m_fontSize;
unsigned m_options;
};
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698