Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
docs
examples
Conic_Weight_b.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=e88f554efacfa9f75f270fb1c0add5b4
5
REG_FIDDLE
(Conic_Weight_b, 256, 256,
true
, 0) {
6
void
draw
(
SkCanvas
* canvas) {
7
const
char
* verbNames[] = {
"move"
,
"line"
,
"quad"
,
"conic"
,
"cubic"
,
"close"
,
"done"
};
8
const
int
pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };
9
SkPath
path;
10
path.arcTo(20, 0, 20, 20, 20);
11
SkPath::Iter
iter(path,
false
);
12
SkPath::Verb
verb;
13
do
{
14
SkPoint
points
[4];
15
verb = iter.
next
(
points
);
16
SkDebugf
(
"%s "
, verbNames[(
int
) verb]);
17
for
(
int
i = 0; i < pointCount[(
int
) verb]; ++i) {
18
SkDebugf
(
"{%g, %g}, "
,
points
[i].fX,
points
[i].fY);
19
}
20
if
(
SkPath::kConic_Verb
== verb) {
21
SkDebugf
(
"weight = %g"
, iter.
conicWeight
());
22
}
23
SkDebugf
(
"\n"
);
24
}
while
(
SkPath::kDone_Verb
!= verb);
25
}
26
}
// 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::Iter::conicWeight
SkScalar conicWeight() const
Definition
SkPath.h:1527
SkPath
Definition
SkPath.h:59
SkPath::Verb
Verb
Definition
SkPath.h:1457
SkPath::kConic_Verb
@ kConic_Verb
Definition
SkPath.h:1461
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:37 for Flutter Engine by
1.9.8