aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-13 08:19:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-13 08:19:58 -0700
commit1e545b6915a2f2e59d917b7fa9695aa15467f61b (patch)
treeb12287573945e99dbf9e2d24905e01e82ac88a3d /gm
parent6f818b39af8058f2818ae2263c823c06df5e2a0a (diff)
make gm text and colors portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1236893002
Diffstat (limited to 'gm')
-rw-r--r--gm/poly2poly.cpp6
-rw-r--r--gm/tilemodes.cpp10
2 files changed, 7 insertions, 9 deletions
diff --git a/gm/poly2poly.cpp b/gm/poly2poly.cpp
index e2563e2f7e..4ab8209ba4 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(&fFillPaint);
+ sk_tool_utils::set_portable_typeface_always(&fFillPaint);
fStrokePaint.setAntiAlias(true);
fStrokePaint.setStyle(SkPaint::kStroke_Style);
fStrokePaint.setStrokeWidth(SK_Scalar1);
@@ -202,7 +202,7 @@ protected:
matrix.setPolyToPoly(src, dst, count);
canvas->concat(matrix);
- paint->setColor(SK_ColorGRAY);
+ paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
paint->setStyle(SkPaint::kStroke_Style);
const SkScalar D = SkIntToScalar(64);
canvas->drawRectCoords(0, 0, D, D, *paint);
@@ -227,7 +227,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setStrokeWidth(SkIntToScalar(4));
paint.setTextSize(SkIntToScalar(40));
paint.setTextAlign(SkPaint::kCenter_Align);
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 391d969c08..5ff84c8db6 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -10,9 +10,7 @@
#include "SkRegion.h"
#include "SkShader.h"
#include "SkUtils.h"
-#include "SkColorPriv.h"
#include "SkColorFilter.h"
-#include "SkTypeface.h"
// effects
#include "SkGradientShader.h"
@@ -100,7 +98,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
p.setDither(true);
str.printf("[%s,%s]", gModeNames[kx], gModeNames[ky]);
@@ -140,7 +138,7 @@ protected:
SkPaint p;
SkString str;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
str.printf("%s, %s", gConfigNames[i], gFilterNames[j]);
canvas->drawText(str.c_str(), str.size(), x, y + r.height() * 2 / 3, p);
}
@@ -168,7 +166,7 @@ static SkShader* make_grad(SkShader::TileMode tx, SkShader::TileMode ty) {
SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(gWidth), SkIntToScalar(gHeight)} };
SkPoint center = { SkIntToScalar(gWidth)/2, SkIntToScalar(gHeight)/2 };
SkScalar rad = SkIntToScalar(gWidth)/2;
- SkColor colors[] = { 0xFFFF0000, 0xFF0044FF };
+ SkColor colors[] = { 0xFFFF0000, sk_tool_utils::color_to_565(0xFF0044FF) };
int index = (int)ty;
switch (index % 3) {
@@ -220,7 +218,7 @@ protected:
SkPaint p;
p.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&p);
+ sk_tool_utils::set_portable_typeface_always(&p);
p.setTextAlign(SkPaint::kCenter_Align);
for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {