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

Go to the source code of this file.

Functions

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

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_addRect_3  ,
256  ,
128  ,
false  ,
 
)

Definition at line 5 of file Path_addRect_3.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));
13 for (auto direction : { SkPathDirection::kCW, SkPathDirection::kCCW } ) {
15 path.addRect(20, 20, 100, 100, direction);
16 canvas->drawPath(path, paint);
17 canvas->translate(128, 0);
18 }
19}
20} // END FIDDLE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
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