make convex poly clip portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1238483002
This commit is contained in:
parent
0c606f493f
commit
2e096609b2
@ -24,10 +24,12 @@ static SkBitmap make_bmp(int w, int h) {
|
|||||||
|
|
||||||
SkScalar radius = 3 * SkMaxScalar(wScalar, hScalar);
|
SkScalar radius = 3 * SkMaxScalar(wScalar, hScalar);
|
||||||
|
|
||||||
SkColor colors[] = { SK_ColorDKGRAY, 0xFF222255,
|
SkColor colors[] = { sk_tool_utils::color_to_565(SK_ColorDKGRAY),
|
||||||
0xFF331133, 0xFF884422,
|
sk_tool_utils::color_to_565(0xFF222255),
|
||||||
0xFF000022, SK_ColorWHITE,
|
sk_tool_utils::color_to_565(0xFF331133),
|
||||||
0xFFAABBCC};
|
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,
|
SkScalar pos[] = {0,
|
||||||
SK_Scalar1 / 6,
|
SK_Scalar1 / 6,
|
||||||
@ -54,10 +56,10 @@ static SkBitmap make_bmp(int w, int h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
paint.setAntiAlias(true);
|
paint.setAntiAlias(true);
|
||||||
sk_tool_utils::set_portable_typeface(&paint);
|
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||||
paint.setTextSize(wScalar / 2.2f);
|
paint.setTextSize(wScalar / 2.2f);
|
||||||
paint.setShader(0);
|
paint.setShader(0);
|
||||||
paint.setColor(SK_ColorLTGRAY);
|
paint.setColor(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
|
||||||
static const char kTxt[] = "Skia";
|
static const char kTxt[] = "Skia";
|
||||||
SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f };
|
SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f };
|
||||||
canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
|
canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
|
||||||
@ -150,8 +152,8 @@ protected:
|
|||||||
SkPaint txtPaint;
|
SkPaint txtPaint;
|
||||||
txtPaint.setTextSize(23.f);
|
txtPaint.setTextSize(23.f);
|
||||||
txtPaint.setAntiAlias(true);
|
txtPaint.setAntiAlias(true);
|
||||||
sk_tool_utils::set_portable_typeface(&txtPaint);
|
sk_tool_utils::set_portable_typeface_always(&txtPaint);
|
||||||
txtPaint.setColor(SK_ColorDKGRAY);
|
txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY));
|
||||||
SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
|
SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
|
||||||
|
|
||||||
SkScalar startX = 0;
|
SkScalar startX = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user