aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/dashing.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-03-16 07:34:02 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-16 07:34:02 -0700
commitd7ea92f2ff8ba41783296ff8e6203a59a5549c1a (patch)
treec712e4c9885d0e430f5b8e367b91de3bbffb5b72 /gm/dashing.cpp
parent523fa2a332d9c621bb871337893270a2bde31ea1 (diff)
pass cap to dash text
Pass the paint cap parameter through to text rendering so that dashed text draws correctly. R=bungeman@google.com BUG=226341 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1776983002 Review URL: https://codereview.chromium.org/1776983002
Diffstat (limited to 'gm/dashing.cpp')
-rw-r--r--gm/dashing.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gm/dashing.cpp b/gm/dashing.cpp
index e44e356b87..0e249c7d61 100644
--- a/gm/dashing.cpp
+++ b/gm/dashing.cpp
@@ -528,6 +528,20 @@ DEF_SIMPLE_GM(longwavyline, canvas, 512, 512) {
canvas->drawPath(wavy, p);
}
+DEF_SIMPLE_GM(dashtextcaps, canvas, 512, 512) {
+ SkPaint p;
+ p.setAntiAlias(true);
+ p.setStyle(SkPaint::kStroke_Style);
+ p.setStrokeWidth(10);
+ p.setStrokeCap(SkPaint::kRound_Cap);
+ p.setTextSize(100);
+ p.setARGB(0xff, 0xbb, 0x00, 0x00);
+ const SkScalar intervals[] = { 12, 12 };
+ p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref();
+ canvas->drawText("Sausages", 8, 10, 90, p);
+ canvas->drawLine(8, 120, 456, 120, p);
+}
+
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new DashingGM;)