Chromium Code Reviews| 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; |