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

Go to the source code of this file.

Functions

 REG_FIDDLE (Path_isRect, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_isRect  ,
256  ,
256  ,
true  ,
 
)

Definition at line 5 of file Path_isRect.cpp.

5 {
6void draw(SkCanvas* canvas) {
7 auto debugster = [](const char* prefix, const SkPath& path) -> void {
9 SkPathDirection direction;
10 bool isClosed;
11 path.isRect(&rect, &isClosed, &direction) ?
12 SkDebugf("%s is rect (%g, %g, %g, %g); is %s" "closed; direction %s\n", prefix,
13 rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, isClosed ? "" : "not ",
14 SkPathDirection::kCW == direction ? "CW" : "CCW") :
15 SkDebugf("%s is not rect\n", prefix);
16 };
18 debugster("empty", path);
19 path.addRect({10, 20, 30, 40});
20 debugster("addRect", path);
21 path.moveTo(60, 70);
22 debugster("moveTo", path);
23 path.lineTo(60, 70);
24 debugster("lineTo", path);
25 path.reset();
26 const SkPoint pts[] = { {0, 0}, {0, 80}, {80, 80}, {80, 0}, {40, 0}, {20, 0} };
27 path.addPoly(pts, std::size(pts), false);
28 debugster("addPoly", path);
29}
30} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SkPathDirection
Definition SkPathTypes.h:34
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
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