Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Path_Iter_const_SkPath.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(Path_Iter_const_SkPath, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 auto debugster = [](const char* prefix, SkPath::Iter& iter) -> void {
7 SkDebugf("%s:\n", prefix);
8 const char* verbStr[] = { "Move", "Line", "Quad", "Conic", "Cubic", "Close", "Done" };
9 const int pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };
10 SkPath::Verb verb;
11 do {
12 SkPoint points[4];
13 verb = iter.next(points);
14 SkDebugf("k%s_Verb ", verbStr[(int) verb]);
15 for (int i = 0; i < pointCount[(int) verb]; ++i) {
16 SkDebugf("{%g, %g}, ", points[i].fX, points[i].fY);
17 }
18 if (SkPath::kConic_Verb == verb) {
19 SkDebugf("weight = %g", iter.conicWeight());
20 }
21 SkDebugf("\n");
22 } while (SkPath::kDone_Verb != verb);
23 SkDebugf("\n");
24 };
26 path.quadTo(10, 20, 30, 40);
27 SkPath::Iter openIter(path, false);
28 debugster("open", openIter);
29 SkPath::Iter closedIter(path, true);
30 debugster("closed", closedIter);
31}
32} // END FIDDLE
static const int points[]
REG_FIDDLE(Path_Iter_const_SkPath, 256, 256, true, 0)
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
Definition: SkPath.h:59
@ kConic_Verb
Definition: SkPath.h:1469
@ kDone_Verb
Definition: SkPath.h:1472
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