1 // Copyright 2019 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"
4 REG_FIDDLE(Path_rCubicTo, 256, 256, false, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 SkPaint paint;
7 paint.setAntiAlias(true);
8 paint.setStyle(SkPaint::kStroke_Style);
9 SkPath path;
10 path.moveTo(24, 108);
11 for (int i = 0; i < 16; i++) {
12 SkScalar sx = SkScalarSin(i * SK_ScalarPI / 8),
13 sy = SkScalarCos(i * SK_ScalarPI / 8);
14 path.rCubicTo(40 * sx, 4 * sy, 4 * sx, 40 * sy, 40 * sx, 40 * sy);
15 }
16 canvas->drawPath(path, paint);
17 }
18 } // END FIDDLE
19