From 70e6d6074a482fb791b9a147f471670be54a0d95 Mon Sep 17 00:00:00 2001 From: caryclark Date: Sat, 30 Jan 2016 10:11:21 -0800 Subject: 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 --- gm/dashing.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gm/dashing.cpp') 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;) -- cgit v1.2.3