Title: [236013] trunk/Source/WebCore
Revision
236013
Author
[email protected]
Date
2018-09-14 11:33:44 -0700 (Fri, 14 Sep 2018)

Log Message

Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
https://bugs.webkit.org/show_bug.cgi?id=189541

Patch by Frederic Wang <[email protected]> on 2018-09-14
Reviewed by Alex Christensen.

FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
FontTaggedSettings::hash() template function. This instantiation may happen before
FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
we declare full specialization of the hash() functions in FontTaggedSettings.h.

No new tests, behavior unchanged.

* platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
* platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (236012 => 236013)


--- trunk/Source/WebCore/ChangeLog	2018-09-14 18:28:29 UTC (rev 236012)
+++ trunk/Source/WebCore/ChangeLog	2018-09-14 18:33:44 UTC (rev 236013)
@@ -1,3 +1,21 @@
+2018-09-14  Frederic Wang  <[email protected]>
+
+        Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
+        https://bugs.webkit.org/show_bug.cgi?id=189541
+
+        Reviewed by Alex Christensen.
+
+        FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
+        FontTaggedSettings::hash() template function. This instantiation may happen before
+        FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
+        compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
+        we declare full specialization of the hash() functions in FontTaggedSettings.h.
+
+        No new tests, behavior unchanged.
+
+        * platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
+        * platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
+
 2018-09-14  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r235990.

Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (236012 => 236013)


--- trunk/Source/WebCore/platform/graphics/FontCache.h	2018-09-14 18:28:29 UTC (rev 236012)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2018-09-14 18:33:44 UTC (rev 236013)
@@ -31,6 +31,7 @@
 
 #include "FontDescription.h"
 #include "FontPlatformData.h"
+#include "FontTaggedSettings.h"
 #include "Timer.h"
 #include <array>
 #include <limits.h>

Modified: trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h (236012 => 236013)


--- trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h	2018-09-14 18:28:29 UTC (rev 236012)
+++ trunk/Source/WebCore/platform/graphics/FontTaggedSettings.h	2018-09-14 18:33:44 UTC (rev 236013)
@@ -139,11 +139,15 @@
 typedef FontTaggedSetting<int> FontFeature;
 typedef FontTaggedSettings<int> FontFeatureSettings;
 
+template <> unsigned FontFeatureSettings::hash() const;
+
 #if ENABLE(VARIATION_FONTS)
 
 typedef FontTaggedSettings<float> FontVariationSettings;
 WTF::TextStream& operator<<(WTF::TextStream&, const FontVariationSettings&);
 
+template <> unsigned FontVariationSettings::hash() const;
+
 #else
 
 struct FontVariationSettings {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to