Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: gm/dashing.cpp

Issue 1651573002: add new tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dashing.cpp
diff --git a/gm/dashing.cpp b/gm/dashing.cpp
index aed4c0019f5d729fb29b49fff5b9064272d5168f..e44e356b8765cd214e0503fd2333e37e603b203a 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;)
« no previous file with comments | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698