1 #if 0 // Disabled until updated to use current API.
2 // Copyright 2019 Google LLC.
3 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4 #include "tools/fiddle/examples.h"
5 // HASH=5acc77eba0cb4d00bbf3a8f4db0c0aee
6 REG_FIDDLE(Arc, 256, 128, false, 0) {
7 void draw(SkCanvas* canvas) {
8 SkRect oval = {8, 8, 56, 56};
10 ovalPaint.setAntiAlias(true);
11 SkPaint textPaint(ovalPaint);
12 ovalPaint.setStyle(SkPaint::kStroke_Style);
13 SkPaint arcPaint(ovalPaint);
14 arcPaint.setStrokeWidth(5);
15 arcPaint.setColor(SK_ColorBLUE);
16 canvas->translate(-64, 0);
17 for (char arcStyle = '1'; arcStyle <= '6'; ++arcStyle) {
18 '4' == arcStyle ? canvas->translate(-96, 55) : canvas->translate(64, 0);
19 canvas->drawText(&arcStyle, 1, 30, 36, textPaint);
20 canvas->drawOval(oval, ovalPaint);
22 path.moveTo({56, 32});
25 path.arcTo(oval, 0, 90, false);
28 canvas->drawArc(oval, 0, 90, false, arcPaint);
31 path.addArc(oval, 0, 90);
34 path.arcTo({56, 56}, {32, 56}, 24);
37 path.arcTo({24, 24}, 0, SkPath::kSmall_ArcSize, SkPathDirection::kCW, {32, 56});
40 path.conicTo({56, 56}, {32, 56}, SK_ScalarRoot2Over2);
43 canvas->drawPath(path, arcPaint);
47 #endif // Disabled until updated to use current API.