1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC.
2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h"
4cb93a386Sopenharmony_ci// HASH=3e476378e3e0550ab134bbaf61112d98
5cb93a386Sopenharmony_ciREG_FIDDLE(Path_cubicTo, 256, 256, false, 0) {
6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) {
7cb93a386Sopenharmony_ci    SkPaint paint;
8cb93a386Sopenharmony_ci    paint.setAntiAlias(true);
9cb93a386Sopenharmony_ci    paint.setStyle(SkPaint::kStroke_Style);
10cb93a386Sopenharmony_ci    SkPath path;
11cb93a386Sopenharmony_ci    path.moveTo(0, -10);
12cb93a386Sopenharmony_ci    for (int i = 0; i < 128; i += 16) {
13cb93a386Sopenharmony_ci        SkScalar c = i * 0.5f;
14cb93a386Sopenharmony_ci        path.cubicTo( 10 + c, -10 - i,  10 + i, -10 - c,  10 + i,       0);
15cb93a386Sopenharmony_ci        path.cubicTo( 14 + i,  14 + c,  14 + c,  14 + i,       0,  14 + i);
16cb93a386Sopenharmony_ci        path.cubicTo(-18 - c,  18 + i, -18 - i,  18 + c, -18 - i,       0);
17cb93a386Sopenharmony_ci        path.cubicTo(-22 - i, -22 - c, -22 - c, -22 - i,       0, -22 - i);
18cb93a386Sopenharmony_ci    }
19cb93a386Sopenharmony_ci    path.offset(128, 128);
20cb93a386Sopenharmony_ci    canvas->drawPath(path, paint);
21cb93a386Sopenharmony_ci}
22cb93a386Sopenharmony_ci}  // END FIDDLE
23