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

Unified Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 447873003: Remove SkPaintOptionsAndroid (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/ports/SkFontConfigInterface_android.cpp
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp
index 1651ac9c05eaf4694d82686b7148ad1d43212657..af0c0ebdbe1ffd9876723365a2323aa80f95e94b 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -69,7 +69,8 @@ struct FamilyRec {
FontRecID fFontRecID[FONT_STYLE_COUNT];
bool fIsFallbackFont;
SkString fFallbackName;
- SkPaintOptionsAndroid fPaintOptions;
+ SkLanguage fLanguage;
+ FontVariant fVariant;
};
@@ -252,12 +253,8 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily*
fontRec.fFamilyRecID = familyRecID;
familyRec->fIsFallbackFont = family->fIsFallbackFont;
- familyRec->fPaintOptions = family->fFontFiles[j].fPaintOptions;
-
- } else if (familyRec->fPaintOptions != family->fFontFiles[j].fPaintOptions) {
- SkDebugf("Every font file within a family must have identical"
- "language and variant attributes");
- sk_throw();
+ familyRec->fLanguage = family->fLanguage;
+ familyRec->fVariant = family->fVariant;
}
// add this font to the current familyRec
@@ -305,7 +302,7 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily*
while(fallbackLang != NULL) {
for (int i = 0; i < fDefaultFallbackList.count(); i++) {
FamilyRecID familyRecID = fDefaultFallbackList[i];
- const SkString& fontLang = fFontFamilies[familyRecID].fPaintOptions.getLanguage().getTag();
+ const SkString& fontLang = fFontFamilies[familyRecID].fLanguage.getTag();
if (strcmp(fallbackLang, fontLang.c_str()) != 0) {
fallbackList->push(familyRecID);
}
@@ -340,7 +337,7 @@ void SkFontConfigInterfaceAndroid::addFallbackFamily(FamilyRecID familyRecID) {
fDefaultFallbackList.push(familyRecID);
// stop here if it is the default language tag
- const SkString& languageTag = familyRec.fPaintOptions.getLanguage().getTag();
+ const SkString& languageTag = familyRec.fLanguage.getTag();
if (languageTag.isEmpty()) {
return;
}
@@ -511,9 +508,9 @@ bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni,
FamilyRecID familyRecID = fallbackFontList->getAt(i);
// if it is not one of the accepted variants then move to the next family
- int32_t acceptedVariants = SkPaintOptionsAndroid::kDefault_Variant |
- SkPaintOptionsAndroid::kElegant_Variant;
- if (!(fFontFamilies[familyRecID].fPaintOptions.getFontVariant() & acceptedVariants)) {
+ int32_t acceptedVariants = kDefault_FontVariant |
+ kElegant_FontVariant;
+ if (!(fFontFamilies[familyRecID].fVariant & acceptedVariants)) {
continue;
}

Powered by Google App Engine
This is Rietveld 408576698