Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkPath_arcTo_example.cpp
Go to the documentation of this file.
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.
4REG_FIDDLE(SkPath_arcTo_example, 512, 512, false, 0) {
5void draw(SkCanvas* canvas) {
6 canvas->clear(SkColorSetARGB(255, 255, 255, 255));
7
9 paint.setAntiAlias(true);
11 paint.setStrokeWidth(2.5);
12
13 SkRect oval = {64, 64, 448, 448};
14 canvas->drawOval(oval, paint);
15 float startAngle = 0;
16 float sweepAngle = 60;
17
18 SkPath arc;
19 arc.arcTo(oval, startAngle, sweepAngle, false);
20
21 paint.setStrokeWidth(5);
22 paint.setColor(SkColorSetARGB(255, 0, 0, 255));
23 canvas->drawPath(arc, paint);
24}
25} // END FIDDLE
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition SkColor.h:49
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawOval(const SkRect &oval, const SkPaint &paint)
void clear(SkColor color)
Definition SkCanvas.h:1199
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
SkPath & arcTo(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
Definition SkPath.cpp:1156
const Paint & paint
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60