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

Unified Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 450513002: Revert "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
« no previous file with comments | « src/core/SkScalerContext.cpp ('k') | 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 af0c0ebdbe1ffd9876723365a2323aa80f95e94b..1651ac9c05eaf4694d82686b7148ad1d43212657 100644
--- a/src/ports/SkFontConfigInterface_android.cpp
+++ b/src/ports/SkFontConfigInterface_android.cpp
@@ -69,8 +69,7 @@ struct FamilyRec {
FontRecID fFontRecID[FONT_STYLE_COUNT];
bool fIsFallbackFont;
SkString fFallbackName;
- SkLanguage fLanguage;
- FontVariant fVariant;
+ SkPaintOptionsAndroid fPaintOptions;
};
@@ -253,8 +252,12 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily*
fontRec.fFamilyRecID = familyRecID;
familyRec->fIsFallbackFont = family->fIsFallbackFont;
- familyRec->fLanguage = family->fLanguage;
- familyRec->fVariant = family->fVariant;
+ 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();
}
// add this font to the current familyRec
@@ -302,7 +305,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].fLanguage.getTag();
+ const SkString& fontLang = fFontFamilies[familyRecID].fPaintOptions.getLanguage().getTag();
if (strcmp(fallbackLang, fontLang.c_str()) != 0) {
fallbackList->push(familyRecID);
}
@@ -337,7 +340,7 @@ void SkFontConfigInterfaceAndroid::addFallbackFamily(FamilyRecID familyRecID) {
fDefaultFallbackList.push(familyRecID);
// stop here if it is the default language tag
- const SkString& languageTag = familyRec.fLanguage.getTag();
+ const SkString& languageTag = familyRec.fPaintOptions.getLanguage().getTag();
if (languageTag.isEmpty()) {
return;
}
@@ -508,9 +511,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 = kDefault_FontVariant |
- kElegant_FontVariant;
- if (!(fFontFamilies[familyRecID].fVariant & acceptedVariants)) {
+ int32_t acceptedVariants = SkPaintOptionsAndroid::kDefault_Variant |
+ SkPaintOptionsAndroid::kElegant_Variant;
+ if (!(fFontFamilies[familyRecID].fPaintOptions.getFontVariant() & acceptedVariants)) {
continue;
}
« no previous file with comments | « src/core/SkScalerContext.cpp ('k') | src/ports/SkFontConfigParser_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698