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

Unified Diff: gm/fontmgr.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 | « no previous file | include/ports/SkFontMgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/fontmgr.cpp
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index be2b11a272fbf6f04d6f607d58c6d70417f8f649..99cff6e4d38a0c95cab7fc7d22132edd2c514083 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -33,16 +33,13 @@ static SkScalar drawString(SkCanvas* canvas, const SkString& text, SkScalar x,
static SkScalar drawCharacter(SkCanvas* canvas, uint32_t character, SkScalar x,
SkScalar y, SkPaint& paint, SkFontMgr* fm,
- const char* fontName, const char* bpc47,
+ const char* fontName, const char* bcp47[], int bcp47Count,
const SkFontStyle& fontStyle) {
// find typeface containing the requested character and draw it
SkString ch;
ch.appendUnichar(character);
-#ifdef SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER
- SkTypeface* typeface = fm->matchFamilyStyleCharacter(fontName, fontStyle, &bpc47, 1, character);
-#else
- SkTypeface* typeface = fm->matchFamilyStyleCharacter(fontName, fontStyle, bpc47, character);
-#endif
+ SkTypeface* typeface = fm->matchFamilyStyleCharacter(fontName, fontStyle,
+ bcp47, bcp47Count, character);
SkSafeUnref(paint.setTypeface(typeface));
x = drawString(canvas, ch, x, y, paint) + 20;
@@ -60,6 +57,9 @@ static SkScalar drawCharacter(SkCanvas* canvas, uint32_t character, SkScalar x,
return drawString(canvas, ch, x, y, paint) + 20;
}
+static const char* zh = "zh";
+static const char* ja = "ja";
+
class FontMgrGM : public skiagm::GM {
public:
FontMgrGM(SkFontMgr* fontMgr = NULL) {
@@ -113,10 +113,10 @@ protected:
x = drawString(canvas, sname, x, y, paint) + 20;
// check to see that we get different glyphs in japanese and chinese
- x = drawCharacter(canvas, 0x5203, x, y, paint, fm, fName.c_str(), "zh", fs);
- x = drawCharacter(canvas, 0x5203, x, y, paint, fm, fName.c_str(), "ja", fs);
+ x = drawCharacter(canvas, 0x5203, x, y, paint, fm, fName.c_str(), &zh, 1, fs);
+ x = drawCharacter(canvas, 0x5203, x, y, paint, fm, fName.c_str(), &ja, 1, fs);
// check that emoji characters are found
- x = drawCharacter(canvas, 0x1f601, x, y, paint, fm, fName.c_str(), NULL, fs);
+ x = drawCharacter(canvas, 0x1f601, x, y, paint, fm, fName.c_str(), NULL, 0, fs);
}
y += 24;
}
« no previous file with comments | « no previous file | include/ports/SkFontMgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698