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

Go to the source code of this file.

Functions

 REG_FIDDLE (Path_Iter_setPath, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_Iter_setPath  ,
256  ,
256  ,
true  ,
 
)

Definition at line 5 of file Path_Iter_setPath.cpp.

5 {
6void draw(SkCanvas* canvas) {
7 auto debugster = [](const char* prefix, SkPath::Iter& iter) -> void {
8 SkDebugf("%s:\n", prefix);
9 const char* verbStr[] = { "Move", "Line", "Quad", "Conic", "Cubic", "Close", "Done" };
10 const int pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };
11 SkPath::Verb verb;
12 do {
13 SkPoint points[4];
14 verb = iter.next(points);
15 SkDebugf("k%s_Verb ", verbStr[(int) verb]);
16 for (int i = 0; i < pointCount[(int) verb]; ++i) {
17 SkDebugf("{%g, %g}, ", points[i].fX, points[i].fY);
18 }
19 if (SkPath::kConic_Verb == verb) {
20 SkDebugf("weight = %g", iter.conicWeight());
21 }
22 SkDebugf("\n");
23 } while (SkPath::kDone_Verb != verb);
24 SkDebugf("\n");
25 };
27 path.quadTo(10, 20, 30, 40);
28 SkPath::Iter iter(path, false);
29 debugster("quad open", iter);
31 path2.conicTo(1, 2, 3, 4, .5f);
32 iter.setPath(path2, true);
33 debugster("conic closed", iter);
34}
35} // END FIDDLE
static const int points[]
static SkPath path2()
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
Type::kYUV Type::kRGBA() int(0.7 *637)
@ kConic_Verb
Definition SkPath.h:1461
@ kDone_Verb
Definition SkPath.h:1464
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Definition SkPath.cpp:756
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