xref: /third_party/skia/docs/examples/maddash.cpp (revision cb93a386)
1// 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(maddash, 400, 200, false, 0) {
5void draw(SkCanvas* canvas) {
6    SkPaint p;
7    p.setColor(SK_ColorRED);
8    p.setAntiAlias(true);
9    p.setStyle(SkPaint::kStroke_Style);
10    p.setStrokeWidth(380);
11
12    SkScalar intvls[] = {2.5, 10000};
13    p.setPathEffect(SkDashPathEffect::Make(intvls, 2, 0));
14
15    canvas->drawCircle(0, 100, 200, p);
16}
17}  // END FIDDLE
18