From 6e79d8204f62c74ced58b58581b8ce09e8f30a6b Mon Sep 17 00:00:00 2001 From: Frederic Wang Date: Wed, 12 Sep 2018 12:05:48 +0200 Subject: [PATCH xserver] bug 189541 --- Source/WebCore/ChangeLog | 19 +++++++++++++++++++ .../WebCore/platform/graphics/FontCache.cpp | 17 +++++++++++++++++ Source/WebCore/platform/graphics/FontCache.h | 17 +---------------- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index e3cf292aeb8..1082bc5a364 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2018-09-12 Frederic Wang + + Move FontDescriptionKey::computeHash into the corresponding implementation file + https://bugs.webkit.org/show_bug.cgi?id=185087 + + Reviewed by NOBODY (OOPS!). + + FontDescriptionKey::computeHash requires implicit instantiation of the FontTaggedSettings template. Since the + function is implemented directly in the header, this instantiation may happen before FontTaggedSettings::hash() is + actually specialized in FontFeatureSettings.cpp or FontVariationSettings.cpp. To avoid compiler errors, the + implementation is moved into FontCache.cpp ; while still marking the function as ALWAYS_INLINE. + + No new tests, behavior unchanged. + + * platform/graphics/FontCache.cpp: + (WebCore::FontDescriptionKey::computeHash const): + * platform/graphics/FontCache.h: + (WebCore::FontDescriptionKey::computeHash const): Deleted. + 2018-09-11 Frederic Wang Refactor filter list checking code diff --git a/Source/WebCore/platform/graphics/FontCache.cpp b/Source/WebCore/platform/graphics/FontCache.cpp index 58773be73c2..a7b1da7b701 100644 --- a/Source/WebCore/platform/graphics/FontCache.cpp +++ b/Source/WebCore/platform/graphics/FontCache.cpp @@ -488,4 +488,21 @@ RefPtr FontCache::similarFont(const FontDescription&, const AtomicString&) } #endif +ALWAYS_INLINE unsigned FontDescriptionKey::computeHash() const +{ + IntegerHasher hasher; + hasher.add(m_size); + hasher.add(m_fontSelectionRequest.weight); + hasher.add(m_fontSelectionRequest.width); + hasher.add(m_fontSelectionRequest.slope.value_or(normalItalicValue())); + hasher.add(m_locale.existingHash()); + for (unsigned flagItem : m_flags) + hasher.add(flagItem); + hasher.add(m_featureSettings.hash()); +#if ENABLE(VARIATION_FONTS) + hasher.add(m_variationSettings.hash()); +#endif + return hasher.hash(); +} + } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/FontCache.h b/Source/WebCore/platform/graphics/FontCache.h index 8564db9c1e0..c354a901167 100644 --- a/Source/WebCore/platform/graphics/FontCache.h +++ b/Source/WebCore/platform/graphics/FontCache.h @@ -104,22 +104,7 @@ struct FontDescriptionKey { bool isHashTableDeletedValue() const { return m_size == cHashTableDeletedSize; } - inline unsigned computeHash() const - { - IntegerHasher hasher; - hasher.add(m_size); - hasher.add(m_fontSelectionRequest.weight); - hasher.add(m_fontSelectionRequest.width); - hasher.add(m_fontSelectionRequest.slope.value_or(normalItalicValue())); - hasher.add(m_locale.existingHash()); - for (unsigned flagItem : m_flags) - hasher.add(flagItem); - hasher.add(m_featureSettings.hash()); -#if ENABLE(VARIATION_FONTS) - hasher.add(m_variationSettings.hash()); -#endif - return hasher.hash(); - } + unsigned computeHash() const; private: static std::array makeFlagsKey(const FontDescription& description) -- 2.18.0