Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
docs
examples
Path_Iter_next.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.
3
#include "
tools/fiddle/examples.h
"
4
// HASH=00ae8984856486bdb626d0ed6587855a
5
REG_FIDDLE
(Path_Iter_next, 256, 256,
true
, 0) {
6
void
draw
(
SkCanvas
* canvas) {
7
SkPath
path;
8
path.moveTo(10, 10);
9
path.moveTo(20, 20);
10
path.quadTo(10, 20, 30, 40);
11
path.moveTo(1, 1);
12
path.close();
13
path.moveTo(30, 30);
14
path.lineTo(30.00001f, 30);
15
16
SkPath::Iter
iter(path,
false
);
17
const
char
* verbStr[] = {
"Move"
,
"Line"
,
"Quad"
,
"Conic"
,
"Cubic"
,
"Close"
,
"Done"
};
18
const
int
pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };
19
SkPath::Verb
verb;
20
do
{
21
SkPoint
points
[4];
22
verb = iter.
next
(
points
);
23
SkDebugf
(
"k%s_Verb "
, verbStr[(
int
) verb]);
24
for
(
int
i = 0; i < pointCount[(
int
) verb]; ++i) {
25
SkDebugf
(
"{%1.8g, %1.8g}, "
,
points
[i].fX,
points
[i].fY);
26
}
27
SkDebugf
(
"\n"
);
28
}
while
(
SkPath::kDone_Verb
!= verb);
29
SkDebugf
(
"\n"
);
30
}
31
}
// END FIDDLE
points
static const int points[]
Definition
HairlinePathBench.cpp:26
SkDebugf
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition
aaclip.cpp:27
int
Type::kYUV Type::kRGBA() int(0.7 *637)
SkCanvas
Definition
SkCanvas.h:106
SkPath::Iter
Definition
SkPath.h:1472
SkPath::Iter::next
Verb next(SkPoint pts[4])
Definition
SkPath.cpp:1837
SkPath
Definition
SkPath.h:59
SkPath::Verb
Verb
Definition
SkPath.h:1457
SkPath::kDone_Verb
@ kDone_Verb
Definition
SkPath.h:1464
examples.h
REG_FIDDLE
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition
examples.h:60
SkPoint
Definition
SkPoint_impl.h:163
Generated on Fri Apr 26 2024 06:15:48 for Flutter Engine by
1.9.8