Flutter Engine
The Flutter Engine
Functions
SkPath_arcTo_example.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (SkPath_arcTo_example, 512, 512, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( SkPath_arcTo_example  ,
512  ,
512  ,
false  ,
 
)

Definition at line 4 of file SkPath_arcTo_example.cpp.

4 {
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)
Definition: SkCanvas.cpp:1698
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
SkPath & arcTo(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
Definition: SkPath.cpp:1220
const Paint & paint
Definition: color_source.cc:38
SkRect oval
Definition: SkRecords.h:249
SkScalar startAngle
Definition: SkRecords.h:250
SkScalar sweepAngle
Definition: SkRecords.h:251