| 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_rQuadTo, 256, 256, false, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPaint paint; |
| 7 |
paint.setAntiAlias(true); |
| 8 |
SkPathBuilder path; |
| 9 |
path.moveTo(128, 20); |
| 10 |
path.rQuadTo(-6, 10, -7, 10); |
| 11 |
for (int i = 1; i < 32; i += 4) { |
| 12 |
path.rQuadTo(10 + i, 10 + i, 10 + i * 4, 10); |
| 13 |
path.rQuadTo(-10 - i, 10 + i, -10 - (i + 2) * 4, 10); |
| 14 |
} |
| 15 |
path.quadTo(92, 220, 128, 215); |
| 16 |
canvas->drawPath(path.detach(), paint); |
| 17 |
} |
| 18 |
} // END FIDDLE |