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

Unified Diff: Source/core/platform/graphics/chromium/FontCacheAndroid.cpp

Issue 14649013: Remove unused complex text fallback logic on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
diff --git a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
index 2cd0c869662481d1870770c7feb5ecbbcc366143..fa64ff9ec2bfcc945b7c0d4875089821cfb402eb 100644
--- a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
+++ b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
@@ -171,39 +171,29 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
SkTypeface* typeface = 0;
FontPlatformData* result = 0;
- FallbackScripts fallbackScript = SkGetFallbackScriptFromID(name);
- if (SkTypeface_ValidScript(fallbackScript)) {
- typeface = SkCreateTypefaceForScript(fallbackScript);
- if (typeface)
- result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
- (style & SkTypeface::kBold) && !typeface->isBold(),
- (style & SkTypeface::kItalic) && !typeface->isItalic(),
- fontDescription.orientation());
- } else {
- typeface = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
-
- // CreateFromName always returns a typeface, falling back to a default font
- // if the one requested could not be found. Calling Equal() with a null
- // pointer will compare the returned font against the default, with the
- // caveat that the default is always of normal style. When that happens,
- // ignore the default font and allow WebCore to provide the next font on the
- // CSS fallback list. The only exception to this occurs when the family name
- // is a commonly used generic family, which is the case when called by
- // getSimilarFontPlatformData() or getLastResortFallbackFont(). In that case
- // the default font is an acceptable result.
-
- if (!SkTypeface::Equal(typeface, 0) || isFallbackFamily(family.string())) {
- // We had to use normal styling to see if this was a default font. If
- // we need bold or italic, replace with the corrected typeface.
- if (style != SkTypeface::kNormal) {
- typeface->unref();
- typeface = SkTypeface::CreateFromName(name, static_cast<SkTypeface::Style>(style));
- }
- result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
- (style & SkTypeface::kBold) && !typeface->isBold(),
- (style & SkTypeface::kItalic) && !typeface->isItalic(),
- fontDescription.orientation());
+ typeface = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
+
+ // CreateFromName always returns a typeface, falling back to a default font
+ // if the one requested could not be found. Calling Equal() with a null
+ // pointer will compare the returned font against the default, with the
+ // caveat that the default is always of normal style. When that happens,
+ // ignore the default font and allow WebCore to provide the next font on the
+ // CSS fallback list. The only exception to this occurs when the family name
+ // is a commonly used generic family, which is the case when called by
+ // getSimilarFontPlatformData() or getLastResortFallbackFont(). In that case
+ // the default font is an acceptable result.
+
+ if (!SkTypeface::Equal(typeface, 0) || isFallbackFamily(family.string())) {
+ // We had to use normal styling to see if this was a default font. If
+ // we need bold or italic, replace with the corrected typeface.
+ if (style != SkTypeface::kNormal) {
+ typeface->unref();
+ typeface = SkTypeface::CreateFromName(name, static_cast<SkTypeface::Style>(style));
}
+ result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
+ (style & SkTypeface::kBold) && !typeface->isBold(),
+ (style & SkTypeface::kItalic) && !typeface->isItalic(),
+ fontDescription.orientation());
}
SkSafeUnref(typeface);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698