diff options
author | caryclark <caryclark@google.com> | 2016-01-30 10:11:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-30 10:11:21 -0800 |
commit | 70e6d6074a482fb791b9a147f471670be54a0d95 (patch) | |
tree | f954d38b38be0805cd6e7deb864af2258b141880 /gm/dashing.cpp | |
parent | 653c12d773def4d25cbdb78072b84404a5d80957 (diff) |
add new tests
These tests are for upcoming changes to optimize
the path edge list.
TBR=reed@google.com
BUG=573166
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1651573002
Review URL: https://codereview.chromium.org/1651573002
Diffstat (limited to 'gm/dashing.cpp')
-rw-r--r-- | gm/dashing.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gm/dashing.cpp b/gm/dashing.cpp index aed4c0019f..e44e356b87 100644 --- a/gm/dashing.cpp +++ b/gm/dashing.cpp @@ -502,6 +502,32 @@ DEF_SIMPLE_GM(longpathdash, canvas, 512, 512) { canvas->drawPath(lines, p); } +DEF_SIMPLE_GM(longlinedash, canvas, 512, 512) { + SkPaint p; + p.setAntiAlias(true); + p.setStyle(SkPaint::kStroke_Style); + p.setStrokeWidth(80); + + const SkScalar intervals[] = { 2, 2 }; + p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref(); + canvas->drawRect(SkRect::MakeXYWH(-10000, 100, 20000, 20), p); +} + +DEF_SIMPLE_GM(longwavyline, canvas, 512, 512) { + SkPaint p; + p.setAntiAlias(true); + p.setStyle(SkPaint::kStroke_Style); + p.setStrokeWidth(2); + + SkPath wavy; + wavy.moveTo(-10000, 100); + for (SkScalar i = -10000; i < 10000; i += 20) { + wavy.quadTo(i + 5, 95, i + 10, 100); + wavy.quadTo(i + 15, 105, i + 20, 100); + } + canvas->drawPath(wavy, p); +} + ////////////////////////////////////////////////////////////////////////////// DEF_GM(return new DashingGM;) |