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

Unified Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 433163002: Remove references to __system_property_get from Skia (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase on tom's change Created 6 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
« no previous file with comments | « no previous file | src/ports/SkFontConfigParser_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontConfigInterface_android.cpp
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp
index bdc3d5092a53614e2f2a7664c641320a45747e92..875bfa736ed888dc6449bfc5dd5761dfc05c1482 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -110,7 +110,6 @@ public:
private:
void addFallbackFamily(FamilyRecID fontRecID);
SkTypeface* getTypefaceForFontRec(FontRecID fontRecID);
- FallbackFontList* getCurrentLocaleFallbackFontList();
FallbackFontList* findFallbackFontList(const SkLanguage& lang, bool isOriginal = true);
SkTArray<FontRec, true> fFonts;
@@ -219,9 +218,8 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily*
get_path_for_sys_fonts(&filename, family->fFontFiles[j].fFileName);
if (has_font(fFonts, filename)) {
- SkDebugf("---- system font and fallback font files specify a duplicate "
- "font %s, skipping the second occurrence", filename.c_str());
- continue;
+ DEBUG_FONT(("---- system font and fallback font files specify a duplicate "
+ "font %s, skipping the second occurrence", filename.c_str()));
}
FontRec& fontRec = fFonts.push_back();
@@ -510,13 +508,12 @@ SkTypeface* SkFontConfigInterfaceAndroid::getTypefaceForFontRec(FontRecID fontRe
bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni,
const char* lang,
SkString* name) {
- FallbackFontList* fallbackFontList = NULL;
- const SkString langTag(lang);
- if (langTag.isEmpty()) {
- fallbackFontList = this->getCurrentLocaleFallbackFontList();
- } else {
- fallbackFontList = this->findFallbackFontList(langTag);
+ const SkString locale(lang);
+ if (NULL == fLocaleFallbackFontList || locale != fCachedLocale) {
+ fCachedLocale = locale;
+ fLocaleFallbackFontList = this->findFallbackFontList(locale);
}
+ FallbackFontList* fallbackFontList = fLocaleFallbackFontList;
for (int i = 0; i < fallbackFontList->count(); i++) {
FamilyRecID familyRecID = fallbackFontList->getAt(i);
@@ -545,15 +542,6 @@ bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni,
return false;
}
-FallbackFontList* SkFontConfigInterfaceAndroid::getCurrentLocaleFallbackFontList() {
- SkString locale = SkFontConfigParser::GetLocale();
- if (NULL == fLocaleFallbackFontList || locale != fCachedLocale) {
- fCachedLocale = locale;
- fLocaleFallbackFontList = this->findFallbackFontList(locale);
- }
- return fLocaleFallbackFontList;
-}
-
FallbackFontList* SkFontConfigInterfaceAndroid::findFallbackFontList(const SkLanguage& lang,
bool isOriginal) {
const SkString& langTag = lang.getTag();
« no previous file with comments | « no previous file | src/ports/SkFontConfigParser_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698