Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Path_addRect.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Path_addRect, 256, 128, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_addRect  ,
256  ,
128  ,
false  ,
 
)

Definition at line 5 of file Path_addRect.cpp.

5 {
6void draw(SkCanvas* canvas) {
8 paint.setStrokeWidth(15);
9 paint.setStrokeCap(SkPaint::kSquare_Cap);
10 float intervals[] = { 5, 21.75f };
12 paint.setPathEffect(SkDashPathEffect::Make(intervals, std::size(intervals), 0));
14 path.addRect({20, 20, 100, 100}, SkPathDirection::kCW);
15 canvas->drawPath(path, paint);
16 path.rewind();
17 path.addRect({140, 20, 220, 100}, SkPathDirection::kCCW);
18 canvas->drawPath(path, paint);
19}
20} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kSquare_Cap
adds square
Definition SkPaint.h:336
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
const Paint & paint
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57