aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-13 05:39:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-13 05:39:47 -0700
commit2e096609b2f09512234ce69dcc0c30f8ab2d1b8f (patch)
treeb7685d0b2e10e4a7e3477c4894289a8f315bf7c0 /gm
parent0c606f493fe22c59ca1d306a51a4a0cd35f4298c (diff)
make convex poly clip portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1238483002
Diffstat (limited to 'gm')
-rw-r--r--gm/convexpolyclip.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/gm/convexpolyclip.cpp b/gm/convexpolyclip.cpp
index 7e616735ea..2eabebac62 100644
--- a/gm/convexpolyclip.cpp
+++ b/gm/convexpolyclip.cpp
@@ -24,10 +24,12 @@ static SkBitmap make_bmp(int w, int h) {
SkScalar radius = 3 * SkMaxScalar(wScalar, hScalar);
- SkColor colors[] = { SK_ColorDKGRAY, 0xFF222255,
- 0xFF331133, 0xFF884422,
- 0xFF000022, SK_ColorWHITE,
- 0xFFAABBCC};
+ SkColor colors[] = { sk_tool_utils::color_to_565(SK_ColorDKGRAY),
+ sk_tool_utils::color_to_565(0xFF222255),
+ sk_tool_utils::color_to_565(0xFF331133),
+ sk_tool_utils::color_to_565(0xFF884422),
+ sk_tool_utils::color_to_565(0xFF000022), SK_ColorWHITE,
+ sk_tool_utils::color_to_565(0xFFAABBCC) };
SkScalar pos[] = {0,
SK_Scalar1 / 6,
@@ -54,10 +56,10 @@ static SkBitmap make_bmp(int w, int h) {
}
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(wScalar / 2.2f);
paint.setShader(0);
- paint.setColor(SK_ColorLTGRAY);
+ paint.setColor(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
static const char kTxt[] = "Skia";
SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f };
canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
@@ -150,8 +152,8 @@ protected:
SkPaint txtPaint;
txtPaint.setTextSize(23.f);
txtPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&txtPaint);
- txtPaint.setColor(SK_ColorDKGRAY);
+ sk_tool_utils::set_portable_typeface_always(&txtPaint);
+ txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY));
SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
SkScalar startX = 0;