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

Unified Diff: Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp

Issue 23503080: Pass DOM locale to Skia in FontCache::getFontDataForCharacter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@fontcleanup
Patch Set: Pure Android only Created 7 years, 3 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
Index: Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
diff --git a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
index e86b3416a043de5dbefdbfdffac218352d9d6eb2..f153cca5ff85a84d9929bbde4b6b5b29ed4827fa 100644
--- a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
+++ b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
@@ -42,6 +42,8 @@
#include "public/platform/linux/WebFontRenderStyle.h"
#include "public/platform/linux/WebSandboxSupport.h"
#include "public/platform/Platform.h"
+#include "wtf/text/AtomicStringHash.h"
+#include "wtf/text/StringHash.h"
#include "wtf/text/StringImpl.h"
#include "wtf/text/WTFString.h"
@@ -124,11 +126,12 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src)
, m_orientation(src.m_orientation)
, m_style(src.m_style)
, m_harfBuzzFace(src.m_harfBuzzFace)
+ , m_locale(src.m_locale)
, m_isHashTableDeletedValue(false)
{
}
-FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation)
+FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation, const AtomicString& locale)
: m_typeface(tf)
, m_family(family)
, m_textSize(textSize)
@@ -136,6 +139,7 @@ FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float tex
, m_fakeBold(fakeBold)
, m_fakeItalic(fakeItalic)
, m_orientation(orientation)
+ , m_locale(locale)
, m_isHashTableDeletedValue(false)
{
querySystemForRenderStyle();
@@ -150,6 +154,7 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
, m_fakeItalic(src.m_fakeItalic)
, m_orientation(src.m_orientation)
, m_harfBuzzFace(src.m_harfBuzzFace)
+ , m_locale(src.m_locale)
, m_isHashTableDeletedValue(false)
{
querySystemForRenderStyle();
@@ -178,6 +183,7 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
m_harfBuzzFace = src.m_harfBuzzFace;
m_orientation = src.m_orientation;
m_style = src.m_style;
+ m_locale = src.m_locale;
m_emSizeInFontUnits = src.m_emSizeInFontUnits;
return *this;
@@ -237,6 +243,7 @@ bool FontPlatformData::operator==(const FontPlatformData& a) const
&& m_fakeItalic == a.m_fakeItalic
&& m_orientation == a.m_orientation
&& m_style == a.m_style
+ && m_locale == a.m_locale
&& m_isHashTableDeletedValue == a.m_isHashTableDeletedValue;
}
@@ -251,6 +258,7 @@ unsigned FontPlatformData::hash() const
uint32_t textSizeBytes;
memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t));
h ^= textSizeBytes;
+ h ^= m_locale.isNull() ? 0 : CaseFoldingHash::hash(m_locale);
return h;
}

Powered by Google App Engine
This is Rietveld 408576698