diff options
author | caryclark <caryclark@google.com> | 2016-03-17 05:33:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-17 05:33:28 -0700 |
commit | d3cfd94228e6e58bb43dc4f799b4e443fba027a3 (patch) | |
tree | bf5bd35d8091167d1cf1cf0431881fb6e12eddfc /gm/bug530095.cpp | |
parent | bbd60689bb080fd147565dbc171f19a6ef177997 (diff) |
don't create zero length intervals
Dashing a pattern without zero-length intervals should
not create them if the end of the on interval coincides
with the beginning of the initial dash offset.
R=reed@google.com
BUG=591993
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1766243004
Committed: https://skia.googlesource.com/skia/+/18bbd00190623fb6cdb119df4a118ac3c1aed52a
Review URL: https://codereview.chromium.org/1766243004
Diffstat (limited to 'gm/bug530095.cpp')
-rw-r--r-- | gm/bug530095.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gm/bug530095.cpp b/gm/bug530095.cpp index 690da3c9d0..76f6bc8f2e 100644 --- a/gm/bug530095.cpp +++ b/gm/bug530095.cpp @@ -46,3 +46,16 @@ DEF_SIMPLE_GM(bug530095, canvas, 900, 1200) { canvas->translate(4, 4); canvas->drawPath(path2, paint); } + +DEF_SIMPLE_GM(bug591993, canvas, 40, 140) { + SkPaint p; + p.setColor(SK_ColorRED); + p.setAntiAlias(true); + p.setStyle(SkPaint::kStroke_Style); + p.setStrokeCap(SkPaint::kRound_Cap); + p.setStrokeWidth(10); + SkScalar intervals[] = { 100, 100 }; + SkPathEffect* dash = SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 100); + p.setPathEffect(dash)->unref(); + canvas->drawLine(20, 20, 120, 20, p); +} |