diff options
author | caryclark <caryclark@google.com> | 2015-07-17 09:39:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-17 09:39:16 -0700 |
commit | dfcb7abc4141826d286d4e51c03d0c94e89f9751 (patch) | |
tree | 53c532f3ee6ed972e7fe7a4afef9e32913fe303e /gm | |
parent | a2a6fe86998035f9930f31a84bce508ada044910 (diff) |
make arithmode bigtext colortype* degeneratesegments gm portable
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1235343004
Diffstat (limited to 'gm')
-rw-r--r-- | gm/arithmode.cpp | 5 | ||||
-rw-r--r-- | gm/bigtext.cpp | 2 | ||||
-rw-r--r-- | gm/colortype.cpp | 2 | ||||
-rw-r--r-- | gm/colortypexfermode.cpp | 4 | ||||
-rw-r--r-- | gm/degeneratesegments.cpp | 8 |
5 files changed, 10 insertions, 11 deletions
diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp index 14f6aa0f57..c58b14e490 100644 --- a/gm/arithmode.cpp +++ b/gm/arithmode.cpp @@ -44,7 +44,8 @@ static SkBitmap make_dst() { SkPaint paint; SkPoint pts[] = { {0, SkIntToScalar(HH)}, {SkIntToScalar(WW), 0} }; SkColor colors[] = { - SK_ColorBLUE, SK_ColorYELLOW, SK_ColorBLACK, SK_ColorGREEN, SK_ColorGRAY + SK_ColorBLUE, SK_ColorYELLOW, SK_ColorBLACK, SK_ColorGREEN, + sk_tool_utils::color_to_565(SK_ColorGRAY) }; SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode); @@ -57,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(&paint); + sk_tool_utils::set_portable_typeface_always(&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 c69d9b973b..8a1faa1e3a 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(&paint); + sk_tool_utils::set_portable_typeface_always(&paint); paint.setTextSize(1500); SkRect r; diff --git a/gm/colortype.cpp b/gm/colortype.cpp index e49f9ecb44..e2c45921b0 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("Times", + SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("serif", SkTypeface::kBold); if (NULL == orig) { orig = SkTypeface::RefDefault(); diff --git a/gm/colortypexfermode.cpp b/gm/colortypexfermode.cpp index 855d11a1a4..7d540110a0 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("Times", + SkTypeface* orig = sk_tool_utils::create_portable_typeface_always("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(&labelP); + sk_tool_utils::set_portable_typeface_always(&labelP); labelP.setTextAlign(SkPaint::kCenter_Align); SkPaint textP; diff --git a/gm/degeneratesegments.cpp b/gm/degeneratesegments.cpp index e5ca18796a..4016e45a28 100644 --- a/gm/degeneratesegments.cpp +++ b/gm/degeneratesegments.cpp @@ -287,8 +287,7 @@ protected: SkPaint titlePaint; titlePaint.setColor(SK_ColorBLACK); titlePaint.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&titlePaint); - titlePaint.setLCDRenderText(true); + sk_tool_utils::set_portable_typeface_always(&titlePaint); titlePaint.setTextSize(15 * SK_Scalar1); const char title[] = "Random Paths Drawn Into Rectangle Clips With " "Indicated Style, Fill and Linecaps, " @@ -317,7 +316,7 @@ protected: canvas->translate(rect.width() + 4*SK_Scalar1, 0); } - SkColor color = 0xff007000; + SkColor color = sk_tool_utils::color_to_565(0xff007000); StyleAndName style = gStyles[(rand.nextU() >> 16) % numStyles]; CapAndName cap = gCaps[(rand.nextU() >> 16) % numCaps]; FillAndName fill = gFills[(rand.nextU() >> 16) % numFills]; @@ -348,8 +347,7 @@ protected: SkPaint labelPaint; labelPaint.setColor(color); labelPaint.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&labelPaint); - labelPaint.setLCDRenderText(true); + sk_tool_utils::set_portable_typeface_always(&labelPaint); labelPaint.setTextSize(10 * SK_Scalar1); canvas->drawText(style.fName, strlen(style.fName), |