diff options
author | Cary Clark <caryclark@skia.org> | 2017-12-13 12:47:15 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-15 16:10:38 +0000 |
commit | 0b1df4b87a6d97d2a590b011e6d748eef3709cb4 (patch) | |
tree | 51ad9e2daf8db3ea8113e5513fa0cfdde9ddc48c /gm | |
parent | 67a86d50f38d3a646ed165f7c6a7d58fda45cbab (diff) |
fix zero length dashed lines
targeted fix turns zero length line
into very short line.
R=egdaniel@google.com
Bug: skia:7387
Change-Id: Ic2a809d30d722f4e8f51d9205666dc1476a10067
Reviewed-on: https://skia-review.googlesource.com/84661
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/strokes.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gm/strokes.cpp b/gm/strokes.cpp index 7bd31c23f4..ed13d090ff 100644 --- a/gm/strokes.cpp +++ b/gm/strokes.cpp @@ -518,3 +518,18 @@ DEF_GM( return new Strokes5GM; ) DEF_GM( return new ZeroLenStrokesGM; ) DEF_GM( return new TeenyStrokesGM; ) + +DEF_SIMPLE_GM(zerolinedash, canvas, 256, 256) { + canvas->clear(SK_ColorWHITE); + + SkPaint paint; + paint.setColor(SkColorSetARGB(255, 0, 0, 0)); + paint.setStrokeWidth(11); + paint.setStrokeCap(SkPaint::kRound_Cap); + paint.setStrokeJoin(SkPaint::kBevel_Join); + + SkScalar dash_pattern[] = {1, 5}; + paint.setPathEffect(SkDashPathEffect::Make(dash_pattern, 2, 0)); + + canvas->drawLine(100, 100, 100, 100, paint); +} |