blob: 9a0da7f86c7d361f3ce7c289dbc25a36c0d12de4 [file] [log] [blame]
Hal Canary6c8422c2020-01-10 15:22:09 -05001// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3#include "tools/fiddle/examples.h"
4REG_FIDDLE(SkParsePath_FromSVGString, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 const char pathString[] =
7 "M 243 128 "
8 "L 24 178 "
9 "L 200 38 "
10 "L 102 240 "
11 "L 102 16 "
12 "L 200 218 "
13 "L 24 78 "
14 "Z";
15 SkPath path;
16 SkParsePath::FromSVGString(pathString, &path);
17 SkPaint paint;
18 paint.setAntiAlias(true);
19 paint.setStyle(SkPaint::kStroke_Style);
20 paint.setStrokeCap(SkPaint::kRound_Cap);
21 paint.setStrokeWidth(2);
22 canvas->drawPath(path, paint);
23}
24} // END FIDDLE