aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bench/TextBlobBench.cpp2
-rw-r--r--dm/DM.cpp2
-rw-r--r--gm/aaxfermodes.cpp2
-rw-r--r--gm/all_bitmap_configs.cpp4
-rw-r--r--gm/arithmode.cpp2
-rw-r--r--gm/bigtext.cpp2
-rw-r--r--gm/bitmapcopy.cpp2
-rw-r--r--gm/bitmapfilters.cpp2
-rw-r--r--gm/bitmapsource.cpp2
-rw-r--r--gm/blurs.cpp2
-rw-r--r--gm/bmpfilterqualityrepeat.cpp2
-rw-r--r--gm/colortype.cpp2
-rw-r--r--gm/colortypexfermode.cpp4
-rw-r--r--gm/colorwheel.cpp2
-rw-r--r--gm/complexclip.cpp2
-rw-r--r--gm/complexclip3.cpp2
-rw-r--r--gm/constcolorprocessor.cpp2
-rw-r--r--gm/convexpolyclip.cpp4
-rw-r--r--gm/cubicpaths.cpp8
-rw-r--r--gm/dcshader.cpp2
-rw-r--r--gm/degeneratesegments.cpp4
-rwxr-xr-xgm/dftext.cpp2
-rw-r--r--gm/displacement.cpp2
-rw-r--r--gm/downsamplebitmap.cpp2
-rw-r--r--gm/drawatlascolor.cpp2
-rw-r--r--gm/drawbitmaprect.cpp2
-rw-r--r--gm/drawlooper.cpp2
-rw-r--r--gm/dropshadowimagefilter.cpp2
-rw-r--r--gm/emptypath.cpp4
-rw-r--r--gm/filterbitmap.cpp2
-rw-r--r--gm/fontcache.cpp4
-rw-r--r--gm/gammatext.cpp2
-rw-r--r--gm/getpostextpath.cpp2
-rw-r--r--gm/glyph_pos.cpp2
-rw-r--r--gm/gradtext.cpp6
-rw-r--r--gm/image.cpp2
-rw-r--r--gm/imageblur.cpp2
-rw-r--r--gm/imageblurtiled.cpp2
-rw-r--r--gm/imagefiltersbase.cpp4
-rw-r--r--gm/imagefilterscropped.cpp2
-rw-r--r--gm/imagefiltersgraph.cpp2
-rw-r--r--gm/imagemagnifier.cpp2
-rw-r--r--gm/imageresizetiled.cpp2
-rw-r--r--gm/internal_links.cpp2
-rw-r--r--gm/largeglyphblur.cpp2
-rw-r--r--gm/lighting.cpp2
-rw-r--r--gm/linepaths.cpp8
-rw-r--r--gm/lumafilter.cpp2
-rw-r--r--gm/matrixconvolution.cpp2
-rw-r--r--gm/mixedtextblobs.cpp2
-rw-r--r--gm/morphology.cpp2
-rw-r--r--gm/offsetimagefilter.cpp2
-rw-r--r--gm/pictureimagefilter.cpp2
-rw-r--r--gm/poly2poly.cpp4
-rw-r--r--gm/quadpaths.cpp8
-rw-r--r--gm/shadertext.cpp2
-rw-r--r--gm/shadertext2.cpp6
-rw-r--r--gm/shadertext3.cpp4
-rw-r--r--gm/simpleaaclip.cpp2
-rw-r--r--gm/srcmode.cpp2
-rw-r--r--gm/strokefill.cpp2
-rw-r--r--gm/stroketext.cpp2
-rw-r--r--gm/textblob.cpp2
-rw-r--r--gm/textblobcolortrans.cpp2
-rw-r--r--gm/textblobgeometrychange.cpp2
-rw-r--r--gm/textblobtransforms.cpp2
-rw-r--r--gm/textblobuseaftergpufree.cpp2
-rw-r--r--gm/texteffects.cpp2
-rw-r--r--gm/tileimagefilter.cpp2
-rw-r--r--gm/tilemodes.cpp6
-rw-r--r--gm/tilemodes_scaled.cpp6
-rw-r--r--gm/variedtext.cpp8
-rw-r--r--gm/xfermodeimagefilter.cpp2
-rw-r--r--gm/xfermodes.cpp2
-rw-r--r--gm/xfermodes2.cpp2
-rw-r--r--gm/xfermodes3.cpp2
-rw-r--r--tools/sk_tool_utils.cpp17
-rw-r--r--tools/sk_tool_utils.h17
78 files changed, 108 insertions, 136 deletions
diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp
index f830001ea9..d110b8d2bb 100644
--- a/bench/TextBlobBench.cpp
+++ b/bench/TextBlobBench.cpp
@@ -30,7 +30,7 @@ public:
protected:
void onPreDraw() override {
- fTypeface.reset(sk_tool_utils::create_portable_typeface("Times", SkTypeface::kNormal));
+ fTypeface.reset(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal));
// make textblob
SkPaint paint;
paint.setTypeface(fTypeface);
diff --git a/dm/DM.cpp b/dm/DM.cpp
index d472be69d9..c488bca7ae 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -757,7 +757,7 @@ static void start_keepalive() {
static SkTypeface* create_from_name(const char familyName[], SkTypeface::Style style) {
if (familyName && strlen(familyName) > sizeof(PORTABLE_FONT_PREFIX)
&& !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_PREFIX) - 1)) {
- return sk_tool_utils::create_portable_typeface_always(familyName, style);
+ return sk_tool_utils::create_portable_typeface(familyName, style);
}
return NULL;
}
diff --git a/gm/aaxfermodes.cpp b/gm/aaxfermodes.cpp
index 378f2bb088..8e66b4337b 100644
--- a/gm/aaxfermodes.cpp
+++ b/gm/aaxfermodes.cpp
@@ -68,7 +68,7 @@ protected:
void onOnceBeforeDraw() override {
fLabelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fLabelPaint);
+ sk_tool_utils::set_portable_typeface(&fLabelPaint);
fLabelPaint.setTextSize(5 * kShapeSize/8);
fLabelPaint.setSubpixelText(true);
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index a0a8f675e1..7ff8675462 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -75,7 +75,7 @@ static void color_wheel_native(SkCanvas* canvas) {
const SkScalar D = 0.3f * SkIntToScalar(SCALE);
const SkScalar X = SkDoubleToScalar(D * sqrt_3_over_2);
const SkScalar Y = D * SK_ScalarHalf;
- sk_tool_utils::set_portable_typeface_always(&p, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface(&p, NULL, SkTypeface::kBold);
p.setTextSize(0.28125f * SCALE);
draw_center_letter('K', &p, SK_ColorBLACK, Z, Z, canvas);
draw_center_letter('R', &p, SK_ColorRED, Z, D, canvas);
@@ -156,7 +156,7 @@ DEF_SIMPLE_GM(all_bitmap_configs, canvas, SCALE, 6 * SCALE) {
SkPaint p;
p.setColor(SK_ColorBLACK);
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p, NULL);
+ sk_tool_utils::set_portable_typeface(&p, NULL);
sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp
index c58b14e490..4b8194464f 100644
--- a/gm/arithmode.cpp
+++ b/gm/arithmode.cpp
@@ -58,7 +58,7 @@ static void show_k_text(SkCanvas* canvas, SkScalar x, SkScalar y, const SkScalar
SkPaint paint;
paint.setTextSize(SkIntToScalar(24));
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
for (int i = 0; i < 4; ++i) {
SkString str;
str.appendScalar(k[i]);
diff --git a/gm/bigtext.cpp b/gm/bigtext.cpp
index 8a1faa1e3a..c69d9b973b 100644
--- a/gm/bigtext.cpp
+++ b/gm/bigtext.cpp
@@ -31,7 +31,7 @@ protected:
void onDraw(SkCanvas* canvas) override {
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(1500);
SkRect r;
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp
index e1268b72dd..ac43db53a7 100644
--- a/gm/bitmapcopy.cpp
+++ b/gm/bitmapcopy.cpp
@@ -77,7 +77,7 @@ protected:
canvas->clear(sk_tool_utils::color_to_565(0xFFDDDDDD));
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkScalar width = SkIntToScalar(40);
SkScalar height = SkIntToScalar(40);
diff --git a/gm/bitmapfilters.cpp b/gm/bitmapfilters.cpp
index 11f93c9868..aeb88d6d22 100644
--- a/gm/bitmapfilters.cpp
+++ b/gm/bitmapfilters.cpp
@@ -53,7 +53,7 @@ static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) {
const int scale = 32;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
const char* name = sk_tool_utils::colortype_name(bm.colorType());
canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8,
paint);
diff --git a/gm/bitmapsource.cpp b/gm/bitmapsource.cpp
index 33752a26e5..a0a3eca663 100644
--- a/gm/bitmapsource.cpp
+++ b/gm/bitmapsource.cpp
@@ -27,7 +27,7 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index e7b66d5265..b1af6850e8 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -40,7 +40,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(25));
canvas->translate(SkIntToScalar(-40), SkIntToScalar(0));
diff --git a/gm/bmpfilterqualityrepeat.cpp b/gm/bmpfilterqualityrepeat.cpp
index edcd6968f5..5c19f00aa3 100644
--- a/gm/bmpfilterqualityrepeat.cpp
+++ b/gm/bmpfilterqualityrepeat.cpp
@@ -51,7 +51,7 @@ protected:
for (size_t q = 0; q < SK_ARRAY_COUNT(kQualities); ++q) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setFilterQuality(kQualities[q].fQuality);
SkPaint bmpPaint(paint);
SkMatrix lm = SkMatrix::I();
diff --git a/gm/colortype.cpp b/gm/colortype.cpp
index e2c45921b0..8e69664130 100644
--- a/gm/colortype.cpp
+++ b/gm/colortype.cpp
@@ -35,7 +35,7 @@ protected:
paint.setAntiAlias(true);
paint.setShader(s)->unref();
- SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("serif",
+ SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
SkTypeface::kBold);
if (NULL == orig) {
orig = SkTypeface::RefDefault();
diff --git a/gm/colortypexfermode.cpp b/gm/colortypexfermode.cpp
index 7d540110a0..97becde944 100644
--- a/gm/colortypexfermode.cpp
+++ b/gm/colortypexfermode.cpp
@@ -42,7 +42,7 @@ protected:
paint.setAntiAlias(true);
paint.setShader(s)->unref();
- SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("serif",
+ SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
SkTypeface::kBold);
if (NULL == orig) {
orig = SkTypeface::RefDefault();
@@ -112,7 +112,7 @@ protected:
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
SkPaint textP;
diff --git a/gm/colorwheel.cpp b/gm/colorwheel.cpp
index f4542b3326..9af52f2484 100644
--- a/gm/colorwheel.cpp
+++ b/gm/colorwheel.cpp
@@ -39,7 +39,7 @@ DEF_SIMPLE_GM(colorwheel, canvas, 256, 256) {
DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface(&paint, NULL, SkTypeface::kBold);
paint.setTextSize(18.0f);
canvas->clear(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
diff --git a/gm/complexclip.cpp b/gm/complexclip.cpp
index 038b1424cb..ba44aa0888 100644
--- a/gm/complexclip.cpp
+++ b/gm/complexclip.cpp
@@ -83,7 +83,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(20));
static const struct {
diff --git a/gm/complexclip3.cpp b/gm/complexclip3.cpp
index 7c22d71eec..ae07d8e274 100644
--- a/gm/complexclip3.cpp
+++ b/gm/complexclip3.cpp
@@ -49,7 +49,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(20));
static const struct {
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index e763305f3b..26898be3bd 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -123,7 +123,7 @@ protected:
// Draw labels for the input to the processor and the processor to the right of
// the test rect. The input label appears above the processor label.
SkPaint labelPaint;
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setAntiAlias(true);
labelPaint.setTextSize(10.f);
SkString inputLabel;
diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp
index c1df69e3b7..0478b51ff0 100644
--- a/gm/convexpolyclip.cpp
+++ b/gm/convexpolyclip.cpp
@@ -56,7 +56,7 @@ static SkBitmap make_bmp(int w, int h) {
}
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(wScalar / 2.2f);
paint.setShader(0);
paint.setColor(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
@@ -150,7 +150,7 @@ protected:
SkPaint txtPaint;
txtPaint.setTextSize(23.f);
txtPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&txtPaint);
+ sk_tool_utils::set_portable_typeface(&txtPaint);
txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY));
SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp
index c8230fc751..b3fca5ac02 100644
--- a/gm/cubicpaths.cpp
+++ b/gm/cubicpaths.cpp
@@ -124,7 +124,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Cubic Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -168,7 +168,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -269,7 +269,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Cubic Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -313,7 +313,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp
index c60c28a3ee..ce73662fb7 100644
--- a/gm/dcshader.cpp
+++ b/gm/dcshader.cpp
@@ -206,7 +206,7 @@ protected:
}
virtual void setFont(SkPaint* paint) {
- sk_tool_utils::set_portable_typeface_always(paint);
+ sk_tool_utils::set_portable_typeface(paint);
}
virtual const char* text() const { return "Hello, Skia!"; }
diff --git a/gm/degeneratesegments.cpp b/gm/degeneratesegments.cpp
index 4016e45a28..df111ac997 100644
--- a/gm/degeneratesegments.cpp
+++ b/gm/degeneratesegments.cpp
@@ -287,7 +287,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Random Paths Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, "
@@ -347,7 +347,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(style.fName,
strlen(style.fName),
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index 3753283eda..0b68add1ca 100755
--- a/gm/dftext.cpp
+++ b/gm/dftext.cpp
@@ -67,7 +67,7 @@ protected:
paint.setAntiAlias(true);
paint.setSubpixelText(true);
- sk_tool_utils::set_portable_typeface_always(&paint, "serif", SkTypeface::kNormal);
+ sk_tool_utils::set_portable_typeface(&paint, "serif", SkTypeface::kNormal);
const char* text = "Hamburgefons";
const size_t textLen = strlen(text);
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index 129682ddec..4450fe2eec 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -38,7 +38,7 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(0xFF884422));
paint.setTextSize(SkIntToScalar(96));
const char* str = "g";
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index bb4736826f..4aceef93f8 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -31,7 +31,7 @@ static void make_checker(SkBitmap* bm, int size, int numChecks) {
}
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface_always(paint, name, style);
+ sk_tool_utils::set_portable_typeface(paint, name, style);
}
class DownsampleBitmapGM : public skiagm::GM {
diff --git a/gm/drawatlascolor.cpp b/gm/drawatlascolor.cpp
index ad0ec50265..a04822f033 100644
--- a/gm/drawatlascolor.cpp
+++ b/gm/drawatlascolor.cpp
@@ -138,7 +138,7 @@ protected:
SkPaint textP;
textP.setTextSize(SkIntToScalar(kTextPad));
textP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textP, NULL);
+ sk_tool_utils::set_portable_typeface(&textP, NULL);
for (int i = 0; i < numModes; ++i) {
canvas->drawText(gModes[i].fLabel, strlen(gModes[i].fLabel),
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index d7b5a9b236..9db5ca71da 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -163,7 +163,7 @@ protected:
blackPaint.setColor(SK_ColorBLACK);
blackPaint.setTextSize(titleHeight);
blackPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&blackPaint);
+ sk_tool_utils::set_portable_typeface(&blackPaint);
SkString title;
title.printf("Bitmap size: %d x %d", gBmpSize, gBmpSize);
canvas->drawText(title.c_str(), title.size(), 0,
diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp
index 74e7e91fe6..624358f7eb 100644
--- a/gm/drawlooper.cpp
+++ b/gm/drawlooper.cpp
@@ -40,7 +40,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(72));
paint.setLooper(fLooper);
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index fd5f5839c6..e06264c9da 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -39,7 +39,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->save();
diff --git a/gm/emptypath.cpp b/gm/emptypath.cpp
index 64eb28694f..ec60bfcaeb 100644
--- a/gm/emptypath.cpp
+++ b/gm/emptypath.cpp
@@ -63,7 +63,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Empty Paths Drawn Into Rectangle Clips With "
"Indicated Style and Fill";
@@ -106,7 +106,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(12 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index d7194c096d..46500ba51f 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -14,7 +14,7 @@
#include "SkTypeface.h"
static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
- sk_tool_utils::set_portable_typeface_always(paint, name, style);
+ sk_tool_utils::set_portable_typeface(paint, name, style);
}
static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) {
diff --git a/gm/fontcache.cpp b/gm/fontcache.cpp
index eb841b0d8a..5f1141e1e9 100644
--- a/gm/fontcache.cpp
+++ b/gm/fontcache.cpp
@@ -40,8 +40,8 @@ protected:
}
void onOnceBeforeDraw() override {
- fTypefaces[0] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kItalic);
- fTypefaces[1] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kItalic);
+ fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic);
+ fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kItalic);
}
void onDraw(SkCanvas* canvas) override {
diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp
index b6d4ea23f2..a46f828784 100644
--- a/gm/gammatext.cpp
+++ b/gm/gammatext.cpp
@@ -20,7 +20,7 @@ static SkShader* make_heatGradient(const SkPoint pts[2]) {
}
static bool setFont(SkPaint* paint, const char name[]) {
- SkTypeface* tf = sk_tool_utils::create_portable_typeface(name, SkTypeface::kNormal);
+ SkTypeface* tf = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
if (tf) {
paint->setTypeface(tf)->unref();
return true;
diff --git a/gm/getpostextpath.cpp b/gm/getpostextpath.cpp
index bb641a06e8..2286602aa7 100644
--- a/gm/getpostextpath.cpp
+++ b/gm/getpostextpath.cpp
@@ -39,7 +39,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(48));
canvas->translate(SkIntToScalar(10), SkIntToScalar(64));
diff --git a/gm/glyph_pos.cpp b/gm/glyph_pos.cpp
index 90329ed7fd..e57f5c6767 100644
--- a/gm/glyph_pos.cpp
+++ b/gm/glyph_pos.cpp
@@ -105,7 +105,7 @@ protected:
paint.setColor(SK_ColorBLACK);
paint.setAntiAlias(true);
paint.setTextSize(kTextHeight * textScale);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStrokeWidth(fStrokeWidth);
paint.setStyle(fStrokeStyle);
diff --git a/gm/gradtext.cpp b/gm/gradtext.cpp
index 0f1a1bfad1..b576ede644 100644
--- a/gm/gradtext.cpp
+++ b/gm/gradtext.cpp
@@ -47,7 +47,7 @@ protected:
virtual SkISize onISize() { return SkISize::Make(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
canvas->clipRect(r);
@@ -76,7 +76,7 @@ protected:
virtual SkISize onISize() { return SkISize::Make(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawText("Normal Fill Text", 16, 0, 50, paint);
@@ -129,7 +129,7 @@ protected:
void onDraw(SkCanvas* canvas) override {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(26));
const SkISize& size = this->getISize();
diff --git a/gm/image.cpp b/gm/image.cpp
index 68bcd7a26f..5e840fbb2f 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -149,7 +149,7 @@ protected:
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(8);
canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint);
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp
index d0f1fd1803..efb5988d65 100644
--- a/gm/imageblur.cpp
+++ b/gm/imageblur.cpp
@@ -41,7 +41,7 @@ protected:
SkRandom rand;
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
for (int i = 0; i < 25; ++i) {
int x = rand.nextULessThan(WIDTH);
int y = rand.nextULessThan(HEIGHT);
diff --git a/gm/imageblurtiled.cpp b/gm/imageblurtiled.cpp
index 5b00b1752a..ed4ae6cef3 100644
--- a/gm/imageblurtiled.cpp
+++ b/gm/imageblurtiled.cpp
@@ -50,7 +50,7 @@ protected:
};
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SkIntToScalar(100));
int posY = 0;
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index 993e65413f..426a4dcde2 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -145,7 +145,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
paint.setImageFilter(imf);
paint.setColor(SK_ColorCYAN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
@@ -283,7 +283,7 @@ protected:
SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag,
};
SkPaint paint(origPaint);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(30);
SkAutoCanvasRestore acr(canvas, true);
diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp
index f06da0ef90..929f2fe3fc 100644
--- a/gm/imagefilterscropped.cpp
+++ b/gm/imagefilterscropped.cpp
@@ -44,7 +44,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index fb3d79fef3..cfedaf0256 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -113,7 +113,7 @@ protected:
canvas.clear(SK_ColorTRANSPARENT);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(SK_ColorWHITE);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/imagemagnifier.cpp b/gm/imagemagnifier.cpp
index 2e739cf38e..ac1941c121 100644
--- a/gm/imagemagnifier.cpp
+++ b/gm/imagemagnifier.cpp
@@ -45,7 +45,7 @@ protected:
int x = rand.nextULessThan(WIDTH);
int y = rand.nextULessThan(HEIGHT);
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
paint.setTextSize(rand.nextRangeScalar(0, 300));
paint.setAntiAlias(true);
diff --git a/gm/imageresizetiled.cpp b/gm/imageresizetiled.cpp
index 724f950446..bc640bc6aa 100644
--- a/gm/imageresizetiled.cpp
+++ b/gm/imageresizetiled.cpp
@@ -56,7 +56,7 @@ protected:
};
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SkIntToScalar(100));
int posY = 0;
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
diff --git a/gm/internal_links.cpp b/gm/internal_links.cpp
index e422868ebc..bb5447e4c4 100644
--- a/gm/internal_links.cpp
+++ b/gm/internal_links.cpp
@@ -61,7 +61,7 @@ private:
canvas->drawRect(rect, paint);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(25));
paint.setColor(SK_ColorBLACK);
canvas->drawText(text, strlen(text), x, y, paint);
diff --git a/gm/largeglyphblur.cpp b/gm/largeglyphblur.cpp
index 9d9ff418cf..8723824e13 100644
--- a/gm/largeglyphblur.cpp
+++ b/gm/largeglyphblur.cpp
@@ -32,7 +32,7 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(256);
paint.setAntiAlias(true);
diff --git a/gm/lighting.cpp b/gm/lighting.cpp
index 345e11e5a9..6df58516b2 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -33,7 +33,7 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/linepaths.cpp b/gm/linepaths.cpp
index 2f5c69236a..e8a4b0b1ca 100644
--- a/gm/linepaths.cpp
+++ b/gm/linepaths.cpp
@@ -82,7 +82,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Line Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -126,7 +126,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -224,7 +224,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Line Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -268,7 +268,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp
index 12c2f95ef5..14237888b1 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -18,7 +18,7 @@ static SkColor kColor2 = SkColorSetARGB(0xff, 0x82, 0xff, 0);
static void draw_label(SkCanvas* canvas, const char* label,
const SkPoint& offset) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
size_t len = strlen(label);
SkScalar width = paint.measureText(label, len);
diff --git a/gm/matrixconvolution.cpp b/gm/matrixconvolution.cpp
index 06684e40d0..b912f90cfe 100644
--- a/gm/matrixconvolution.cpp
+++ b/gm/matrixconvolution.cpp
@@ -30,7 +30,7 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(180));
SkPoint pts[2] = { SkPoint::Make(0, 0),
diff --git a/gm/mixedtextblobs.cpp b/gm/mixedtextblobs.cpp
index 681b0b7cb1..32ebdec924 100644
--- a/gm/mixedtextblobs.cpp
+++ b/gm/mixedtextblobs.cpp
@@ -50,7 +50,7 @@ protected:
SkPaint paint;
paint.setTextSize(385);
const char* text = "O";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/morphology.cpp b/gm/morphology.cpp
index e12c8fb8aa..cb321c6efd 100644
--- a/gm/morphology.cpp
+++ b/gm/morphology.cpp
@@ -31,7 +31,7 @@ protected:
canvas.clear(0x0);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
const char* str1 = "ABC";
const char* str2 = "XYZ";
paint.setColor(0xFFFFFFFF);
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index 0891ae5a85..35ccc053c4 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -31,7 +31,7 @@ protected:
canvas.clear(0);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(sk_tool_utils::color_to_565(0xD000D000));
paint.setTextSize(96);
canvas.drawText("e", 1, 15, 65, paint);
diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp
index a951cb403d..fd8ae62fa2 100644
--- a/gm/pictureimagefilter.cpp
+++ b/gm/pictureimagefilter.cpp
@@ -28,7 +28,7 @@ protected:
canvas->clear(SK_ColorBLACK);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/poly2poly.cpp b/gm/poly2poly.cpp
index 4ab8209ba4..72ab7276e1 100644
--- a/gm/poly2poly.cpp
+++ b/gm/poly2poly.cpp
@@ -37,7 +37,7 @@ private:
SkJSCanvas::SkJSCanvas(SkCanvas* target) : fTarget(target) {
fFillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fFillPaint);
+ sk_tool_utils::set_portable_typeface(&fFillPaint);
fStrokePaint.setAntiAlias(true);
fStrokePaint.setStyle(SkPaint::kStroke_Style);
fStrokePaint.setStrokeWidth(SK_Scalar1);
@@ -227,7 +227,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setStrokeWidth(SkIntToScalar(4));
paint.setTextSize(SkIntToScalar(40));
paint.setTextAlign(SkPaint::kCenter_Align);
diff --git a/gm/quadpaths.cpp b/gm/quadpaths.cpp
index 5e4b7a43a7..2fab37bfb0 100644
--- a/gm/quadpaths.cpp
+++ b/gm/quadpaths.cpp
@@ -83,7 +83,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Quad Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -127,7 +127,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
@@ -227,7 +227,7 @@ protected:
SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&titlePaint);
+ sk_tool_utils::set_portable_typeface(&titlePaint);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Quad Closed Drawn Into Rectangle Clips With "
"Indicated Style, Fill and Linecaps, with stroke width 10";
@@ -271,7 +271,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(10 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
diff --git a/gm/shadertext.cpp b/gm/shadertext.cpp
index 599cff3469..2bb4e96d92 100644
--- a/gm/shadertext.cpp
+++ b/gm/shadertext.cpp
@@ -144,7 +144,7 @@ protected:
SkPaint paint;
paint.setDither(true);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(pointSize));
canvas->save();
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index cd996b3031..4d697d9a5f 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -90,13 +90,13 @@ protected:
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fillPaint);
+ sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&outlinePaint);
+ sk_tool_utils::set_portable_typeface(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -112,7 +112,7 @@ protected:
SkPaint labelPaint;
labelPaint.setColor(0xff000000);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelPaint);
+ sk_tool_utils::set_portable_typeface(&labelPaint);
labelPaint.setTextSize(12.f);
canvas->translate(15.f, 15.f);
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp
index 47dd29e60c..07ecd7184b 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -73,7 +73,7 @@ protected:
SkPaint outlinePaint;
outlinePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&outlinePaint);
+ sk_tool_utils::set_portable_typeface(&outlinePaint);
outlinePaint.setTextSize(SkIntToScalar(kPointSize));
outlinePaint.setStyle(SkPaint::kStroke_Style);
outlinePaint.setStrokeWidth(0.f);
@@ -107,7 +107,7 @@ protected:
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&fillPaint);
+ sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
fillPaint.setShader(shader);
diff --git a/gm/simpleaaclip.cpp b/gm/simpleaaclip.cpp
index 1745eb1af4..bd9fe2b900 100644
--- a/gm/simpleaaclip.cpp
+++ b/gm/simpleaaclip.cpp
@@ -156,7 +156,7 @@ protected:
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&textPaint);
+ sk_tool_utils::set_portable_typeface(&textPaint);
textPaint.setTextSize(SK_Scalar1*24);
int xOff = 0;
diff --git a/gm/srcmode.cpp b/gm/srcmode.cpp
index d089902b70..ec2673f94a 100644
--- a/gm/srcmode.cpp
+++ b/gm/srcmode.cpp
@@ -80,7 +80,7 @@ protected:
canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0x80F60000);
const Proc procs[] = {
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index f523413fa1..a7e404dabf 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -283,7 +283,7 @@ protected:
// use the portable typeface to generically test the fake bold code everywhere
// (as long as the freetype option to do the bolding itself isn't enabled)
- sk_tool_utils::set_portable_typeface_always(&paint, "serif");
+ sk_tool_utils::set_portable_typeface(&paint, "serif");
const unsigned char hiThere[] = "Hi There";
show_bold(canvas, hiThere, SK_ARRAY_COUNT(hiThere), x + SkIntToScalar(430), y, paint);
diff --git a/gm/stroketext.cpp b/gm/stroketext.cpp
index b6c7b1ef6b..6ec425b5b2 100644
--- a/gm/stroketext.cpp
+++ b/gm/stroketext.cpp
@@ -84,7 +84,7 @@ protected:
if (true) { test_nulldev(canvas); }
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(kBelowThreshold_TextSize);
draw_text_set(canvas, paint);
diff --git a/gm/textblob.cpp b/gm/textblob.cpp
index aee32b3422..cd5c12a74d 100644
--- a/gm/textblob.cpp
+++ b/gm/textblob.cpp
@@ -72,7 +72,7 @@ public:
protected:
void onOnceBeforeDraw() override {
- fTypeface.reset(sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kNormal));
+ fTypeface.reset(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal));
SkPaint p;
p.setTypeface(fTypeface);
size_t txtLen = strlen(fText);
diff --git a/gm/textblobcolortrans.cpp b/gm/textblobcolortrans.cpp
index b6776813b1..8b5413a6e9 100644
--- a/gm/textblobcolortrans.cpp
+++ b/gm/textblobcolortrans.cpp
@@ -31,7 +31,7 @@ protected:
SkPaint paint;
paint.setTextSize(256);
const char* text = "AB";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp
index fa48ee09bc..fec1ac050d 100644
--- a/gm/textblobgeometrychange.cpp
+++ b/gm/textblobgeometrychange.cpp
@@ -31,7 +31,7 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(20);
paint.setAntiAlias(true);
paint.setLCDRenderText(true);
diff --git a/gm/textblobtransforms.cpp b/gm/textblobtransforms.cpp
index 76342e593f..0813d87637 100644
--- a/gm/textblobtransforms.cpp
+++ b/gm/textblobtransforms.cpp
@@ -28,7 +28,7 @@ protected:
SkPaint paint;
paint.setTextSize(162);
const char* text = "A";
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
SkRect bounds;
paint.measureText(text, strlen(text), &bounds);
diff --git a/gm/textblobuseaftergpufree.cpp b/gm/textblobuseaftergpufree.cpp
index b949fadf1c..3994c5ddde 100644
--- a/gm/textblobuseaftergpufree.cpp
+++ b/gm/textblobuseaftergpufree.cpp
@@ -39,7 +39,7 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setAntiAlias(true);
paint.setTextSize(20);
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index af4b12e1a6..03dbd68cc1 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -188,7 +188,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(SkIntToScalar(56));
SkScalar x = SkIntToScalar(20);
diff --git a/gm/tileimagefilter.cpp b/gm/tileimagefilter.cpp
index 5cf8ab1281..9d0f95e15c 100644
--- a/gm/tileimagefilter.cpp
+++ b/gm/tileimagefilter.cpp
@@ -23,7 +23,7 @@ static SkBitmap make_bitmap() {
canvas.clear(0xFF000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xD000D000);
paint.setTextSize(SkIntToScalar(50));
const char* str = "e";
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 5ff84c8db6..4e4a2ff8ce 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -98,7 +98,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setDither(true);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
@@ -138,7 +138,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p);
}
@@ -218,7 +218,7 @@ protected:
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
diff --git a/gm/tilemodes_scaled.cpp b/gm/tilemodes_scaled.cpp
index 3d86bc4cd9..87e3029a01 100644
--- a/gm/tilemodes_scaled.cpp
+++ b/gm/tilemodes_scaled.cpp
@@ -102,7 +102,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
p.setTextAlign(SkPaint::kCenter_Align);
@@ -142,7 +142,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
str.printf("%s, %s", gColorTypeNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), scale*x, scale*(y + r.height() * 2 / 3), p);
}
@@ -222,7 +222,7 @@ protected:
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&p);
+ sk_tool_utils::set_portable_typeface(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
diff --git a/gm/variedtext.cpp b/gm/variedtext.cpp
index b2b96b34c5..97b3f577e5 100644
--- a/gm/variedtext.cpp
+++ b/gm/variedtext.cpp
@@ -59,10 +59,10 @@ protected:
SkScalar h = SkIntToScalar(size.fHeight);
SK_COMPILE_ASSERT(4 == SK_ARRAY_COUNT(fTypefacesToUnref), typeface_cnt);
- fTypefacesToUnref[0] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kNormal);
- fTypefacesToUnref[1] = sk_tool_utils::create_portable_typeface_always("sans-serif", SkTypeface::kBold);
- fTypefacesToUnref[2] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kNormal);
- fTypefacesToUnref[3] = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kBold);
+ fTypefacesToUnref[0] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kNormal);
+ fTypefacesToUnref[1] = sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kBold);
+ fTypefacesToUnref[2] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kNormal);
+ fTypefacesToUnref[3] = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold);
SkRandom random;
for (int i = 0; i < kCnt; ++i) {
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index 1ba1886533..3efbbfad6a 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -35,7 +35,7 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&paint);
+ sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xD000D000);
paint.setTextSize(SkIntToScalar(96));
const char* str = "e";
diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp
index 93c8bf212c..aae8cbd234 100644
--- a/gm/xfermodes.cpp
+++ b/gm/xfermodes.cpp
@@ -232,7 +232,7 @@ protected:
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
const int W = 5;
diff --git a/gm/xfermodes2.cpp b/gm/xfermodes2.cpp
index ab57dcf703..192a279bf4 100644
--- a/gm/xfermodes2.cpp
+++ b/gm/xfermodes2.cpp
@@ -34,7 +34,7 @@ protected:
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
labelP.setTextAlign(SkPaint::kCenter_Align);
const int W = 6;
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index d4659f0810..c5e1695399 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -46,7 +46,7 @@ protected:
SkPaint labelP;
labelP.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface_always(&labelP);
+ sk_tool_utils::set_portable_typeface(&labelP);
static const SkColor kSolidColors[] = {
SK_ColorTRANSPARENT,
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index 4897938f00..a6d381e2cf 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -26,7 +26,7 @@ static const char* gStandardFontNames[][3] = {
{ "Times New Roman", "Helvetica", "Courier" }, // iOS
{ "Times New Roman", "Arial", "Courier New" }, // Win
{ "Times New Roman", "Arial", "Monospace" }, // Ubuntu
- { "Droid Serif", "Droid Sans", "Droid Sans Mono" }, // Android
+ { "serif", "sans-serif", "monospace" }, // Android
{ "Tinos", "Arimo", "Cousine" } // ChromeOS
};
@@ -159,25 +159,10 @@ SkColor color_to_565(SkColor color) {
}
SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style) {
- SkTypeface* face;
- if (FLAGS_portableFonts) {
- face = create_font(name, style);
- } else {
- face = SkTypeface::CreateFromName(name, style);
- }
- return face;
-}
-
-SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::Style style) {
return create_font(name, style);
}
void set_portable_typeface(SkPaint* paint, const char* name, SkTypeface::Style style) {
- SkTypeface* face = create_portable_typeface(name, style);
- SkSafeUnref(paint->setTypeface(face));
-}
-
-void set_portable_typeface_always(SkPaint* paint, const char* name, SkTypeface::Style style) {
SkTypeface* face = create_font(name, style);
SkSafeUnref(paint->setTypeface(face));
}
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h
index 59ae66a3bb..1d1d365285 100644
--- a/tools/sk_tool_utils.h
+++ b/tools/sk_tool_utils.h
@@ -66,28 +66,15 @@ namespace sk_tool_utils {
const char* platform_font_name(const char* name);
/**
- * Sets the paint to use a platform-independent text renderer if FLAGS_portableFonts is set.
- * FIXME: will become obsolete as GMs migrate to set portable typeface always.
- */
- void set_portable_typeface(SkPaint* paint, const char* name = NULL,
- SkTypeface::Style style = SkTypeface::kNormal);
-
- /**
* Sets the paint to use a platform-independent text renderer
*/
- void set_portable_typeface_always(SkPaint* paint, const char* name = NULL,
+ void set_portable_typeface(SkPaint* paint, const char* name = NULL,
SkTypeface::Style style = SkTypeface::kNormal);
- /**
- * Returns a platform-independent text renderer if FLAGS_portableFonts is set.
- * FIXME: will become obsolete as GMs migrate to set portable typeface always.
- */
- SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style);
-
/**
* Returns a platform-independent text renderer.
*/
- SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::Style style);
+ SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style);
/** Call to clean up portable font references. */
void release_portable_typefaces();