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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 705843004: Remove SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test. Created 6 years, 1 month 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/fonts/SkFontMgr_indirect.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 508ad4c9c13f3415bd11cd1e50ef198e430f61b3..fb77b2764d795cce63cd944c49a0bb429aed063a 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -340,51 +340,42 @@ protected:
return NULL;
}
-static SkTypeface_AndroidSystem* find_family_style_character(
- const SkTDArray<NameToFamily>& fallbackNameToFamilyMap,
- const SkFontStyle& style, bool elegant,
- const SkString& langTag, SkUnichar character)
-{
- for (int i = 0; i < fallbackNameToFamilyMap.count(); ++i) {
- SkFontStyleSet_Android* family = fallbackNameToFamilyMap[i].styleSet;
- SkAutoTUnref<SkTypeface_AndroidSystem> face(family->matchStyle(style));
-
- if (!langTag.isEmpty() && !face->fLang.getTag().startsWith(langTag.c_str())) {
- continue;
- }
+ static SkTypeface_AndroidSystem* find_family_style_character(
+ const SkTDArray<NameToFamily>& fallbackNameToFamilyMap,
+ const SkFontStyle& style, bool elegant,
+ const SkString& langTag, SkUnichar character)
+ {
+ for (int i = 0; i < fallbackNameToFamilyMap.count(); ++i) {
+ SkFontStyleSet_Android* family = fallbackNameToFamilyMap[i].styleSet;
+ SkAutoTUnref<SkTypeface_AndroidSystem> face(family->matchStyle(style));
- if (SkToBool(face->fVariantStyle & kElegant_FontVariant) != elegant) {
- continue;
- }
+ if (!langTag.isEmpty() && !face->fLang.getTag().startsWith(langTag.c_str())) {
+ continue;
+ }
- SkPaint paint;
- paint.setTypeface(face);
- paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
+ if (SkToBool(face->fVariantStyle & kElegant_FontVariant) != elegant) {
+ continue;
+ }
- uint16_t glyphID;
- paint.textToGlyphs(&character, sizeof(character), &glyphID);
- if (glyphID != 0) {
- return face.detach();
+ SkPaint paint;
+ paint.setTypeface(face);
+ paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
+
+ uint16_t glyphID;
+ paint.textToGlyphs(&character, sizeof(character), &glyphID);
+ if (glyphID != 0) {
+ return face.detach();
+ }
}
+ return NULL;
}
- return NULL;
-}
-#ifdef SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER
+
virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
const SkFontStyle& style,
const char* bcp47[],
int bcp47Count,
SkUnichar character) const SK_OVERRIDE
{
-#else
- virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[],
- const SkFontStyle& style,
- const char bcp47_val[],
- SkUnichar character) const SK_OVERRIDE
- {
- const char** bcp47 = &bcp47_val;
- int bcp47Count = bcp47_val ? 1 : 0;
-#endif
// The variant 'elegant' is 'not squashed', 'compact' is 'stays in ascent/descent'.
// The variant 'default' means 'compact and elegant'.
// As a result, it is not possible to know the variant context from the font alone.
« no previous file with comments | « src/fonts/SkFontMgr_indirect.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698