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

Unified Diff: Source/core/platform/graphics/skia/FontCacheSkia.cpp

Issue 23480016: Switch non-gdi windows font path to use new SkFontMgr (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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/skia/FontCacheSkia.cpp
diff --git a/Source/core/platform/graphics/skia/FontCacheSkia.cpp b/Source/core/platform/graphics/skia/FontCacheSkia.cpp
index cba5debca22aca4f0f88ad8c12ce825e70df82a5..e9ccb8159ba0ed5f69bf6bfcf77650f3d6a3d966 100644
--- a/Source/core/platform/graphics/skia/FontCacheSkia.cpp
+++ b/Source/core/platform/graphics/skia/FontCacheSkia.cpp
@@ -110,7 +110,7 @@ void FontCache::getTraitsInFamily(const AtomicString& familyName,
notImplemented();
}
-SkTypeface* FontCache::createTypeface(const FontDescription& fontDescription, const AtomicString& family, CString& name)
+void FontCache::getFontNameIncludingFallback(const FontDescription& fontDescription, const AtomicString& family, CString& name)
bungeman-chromium 2013/08/31 02:57:24 I really liked the createTypeface abstraction, it
eae 2013/09/03 21:04:14 I agree, I'll add the windows-specific code in her
{
name = "";
@@ -139,6 +139,13 @@ SkTypeface* FontCache::createTypeface(const FontDescription& fontDescription, co
// convert the name to utf8
name = family.string().utf8();
}
+}
+
+#if !OS(WINDOWS)
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
+{
+ CString name;
+ getFontNameIncludingFallback(fontDescription, family, name);
int style = SkTypeface::kNormal;
if (fontDescription.weight() >= FontWeightBold)
@@ -146,14 +153,7 @@ SkTypeface* FontCache::createTypeface(const FontDescription& fontDescription, co
if (fontDescription.italic())
style |= SkTypeface::kItalic;
- return SkTypeface::CreateFromName(name.data(), static_cast<SkTypeface::Style>(style));
-}
-
-#if !OS(WINDOWS)
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
-{
- CString name;
- SkTypeface* tf = createTypeface(fontDescription, family, name);
+ SkTypeface* tf = SkTypeface::CreateFromName(name.data(), static_cast<SkTypeface::Style>(style));
if (!tf)
return 0;

Powered by Google App Engine
This is Rietveld 408576698