Flutter Engine
The Flutter Engine
|
#include <SkPathBuilder.h>
Public Types | |
enum | ArcSize { kSmall_ArcSize , kLarge_ArcSize } |
Friends | |
class | SkPathPriv |
Definition at line 25 of file SkPathBuilder.h.
Enumerator | |
---|---|
kSmall_ArcSize | smaller of arc pair |
kLarge_ArcSize | larger of arc pair |
Definition at line 141 of file SkPathBuilder.h.
SkPathBuilder::SkPathBuilder | ( | ) |
Definition at line 27 of file SkPathBuilder.cpp.
SkPathBuilder::SkPathBuilder | ( | SkPathFillType | ft | ) |
Definition at line 31 of file SkPathBuilder.cpp.
SkPathBuilder::SkPathBuilder | ( | const SkPath & | src | ) |
Definition at line 36 of file SkPathBuilder.cpp.
|
default |
SkPathBuilder::~SkPathBuilder | ( | ) |
Definition at line 40 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::addArc | ( | const SkRect & | oval, |
SkScalar | startAngleDeg, | ||
SkScalar | sweepAngleDeg | ||
) |
Appends arc to the builder, as the start of new contour. Arc added is part of ellipse bounded by oval, from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees is aligned with the positive x-axis, and positive sweeps extends arc clockwise.
If sweepAngle <= -360, or sweepAngle >= 360; and startAngle modulo 90 is nearly zero, append oval instead of arc. Otherwise, sweepAngle values are treated modulo 360, and arc may or may not draw depending on numeric rounding.
oval | bounds of ellipse containing arc |
startAngleDeg | starting angle of arc in degrees |
sweepAngleDeg | sweep, in degrees. Positive is clockwise; treated modulo 360 |
Definition at line 394 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::addCircle | ( | SkScalar | center_x, |
SkScalar | center_y, | ||
SkScalar | radius, | ||
SkPathDirection | dir = SkPathDirection::kCW |
||
) |
Definition at line 759 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::addOval | ( | const SkRect & | oval, |
SkPathDirection | dir, | ||
unsigned | startIndex | ||
) |
Definition at line 682 of file SkPathBuilder.cpp.
|
inline |
Definition at line 197 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::addPath | ( | const SkPath & | src | ) |
Definition at line 800 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::addPolygon | ( | const SkPoint | pts[], |
int | count, | ||
bool | isClosed | ||
) |
Definition at line 766 of file SkPathBuilder.cpp.
|
inline |
Definition at line 210 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::addRect | ( | const SkRect & | rect, |
SkPathDirection | dir, | ||
unsigned | startIndex | ||
) |
Definition at line 668 of file SkPathBuilder.cpp.
|
inline |
Definition at line 194 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::addRRect | ( | const SkRRect & | rrect, |
SkPathDirection | dir, | ||
unsigned | startIndex | ||
) |
Definition at line 708 of file SkPathBuilder.cpp.
|
inline |
Definition at line 201 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::arcTo | ( | const SkRect & | oval, |
SkScalar | startAngleDeg, | ||
SkScalar | sweepAngleDeg, | ||
bool | forceMoveTo | ||
) |
Appends arc to the builder. Arc added is part of ellipse bounded by oval, from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees is aligned with the positive x-axis, and positive sweeps extends arc clockwise.
arcTo() adds line connecting the builder's last point to initial arc point if forceMoveTo is false and the builder is not empty. Otherwise, added contour begins with first point of arc. Angles greater than -360 and less than 360 are treated modulo 360.
oval | bounds of ellipse containing arc |
startAngleDeg | starting angle of arc in degrees |
sweepAngleDeg | sweep, in degrees. Positive is clockwise; treated modulo 360 |
forceMoveTo | true to start a new contour with arc |
Definition at line 331 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::arcTo | ( | SkPoint | p1, |
SkPoint | p2, | ||
SkScalar | radius | ||
) |
Appends arc to SkPath, after appending line if needed. Arc is implemented by conic weighted to describe part of circle. Arc is contained by tangent from last SkPath point to p1, and tangent from p1 to p2. Arc is part of circle sized to radius, positioned so it touches both tangent lines.
If last SkPath SkPoint does not start arc, arcTo() appends connecting line to SkPath. The length of vector from p1 to p2 does not affect arc.
Arc sweep is always less than 180 degrees. If radius is zero, or if tangents are nearly parallel, arcTo() appends line from last SkPath SkPoint to p1.
arcTo() appends at most one line and one conic. arcTo() implements the functionality of PostScript arct and HTML Canvas arcTo.
p1 | SkPoint common to pair of tangents |
p2 | end of second tangent |
radius | distance from arc to circle center |
Definition at line 418 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::arcTo | ( | SkPoint | r, |
SkScalar | xAxisRotate, | ||
SkPathBuilder::ArcSize | arcLarge, | ||
SkPathDirection | sweep, | ||
SkPoint | xy | ||
) |
Appends arc to SkPath. Arc is implemented by one or more conic weighted to describe part of oval with radii (r.fX, r.fY) rotated by xAxisRotate degrees. Arc curves from last SkPath SkPoint to (xy.fX, xy.fY), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger.
Arc sweep is always less than 360 degrees. arcTo() appends line to xy if either radii are zero, or if last SkPath SkPoint equals (xy.fX, xy.fY). arcTo() scales radii r to fit last SkPath SkPoint and xy if both are greater than zero but too small to describe an arc.
arcTo() appends up to four conic curves. arcTo() implements the functionality of SVG arc, although SVG sweep-flag value is opposite the integer value of sweep; SVG sweep-flag uses 1 for clockwise, while kCW_Direction cast to int is zero.
r | radii on axes before x-axis rotation |
xAxisRotate | x-axis rotation in degrees; positive values are clockwise |
largeArc | chooses smaller or larger arc |
sweep | chooses clockwise or counterclockwise arc |
xy | end of arc |
Definition at line 460 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::close | ( | ) |
Definition at line 155 of file SkPathBuilder.cpp.
SkRect SkPathBuilder::computeBounds | ( | ) | const |
Definition at line 81 of file SkPathBuilder.cpp.
|
inline |
Definition at line 63 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::conicTo | ( | SkPoint | pt1, |
SkPoint | pt2, | ||
SkScalar | w | ||
) |
Definition at line 129 of file SkPathBuilder.cpp.
|
inline |
Definition at line 60 of file SkPathBuilder.h.
|
inline |
Definition at line 71 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::cubicTo | ( | SkPoint | pt1, |
SkPoint | pt2, | ||
SkPoint | pt3 | ||
) |
Definition at line 142 of file SkPathBuilder.cpp.
|
inline |
Definition at line 68 of file SkPathBuilder.h.
SkPath SkPathBuilder::detach | ( | ) |
Definition at line 239 of file SkPathBuilder.cpp.
|
inline |
Definition at line 36 of file SkPathBuilder.h.
|
inline |
Definition at line 219 of file SkPathBuilder.h.
Definition at line 76 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::lineTo | ( | SkPoint | pt | ) |
Definition at line 107 of file SkPathBuilder.cpp.
|
inline |
Definition at line 51 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::moveTo | ( | SkPoint | pt | ) |
Definition at line 95 of file SkPathBuilder.cpp.
|
inline |
Definition at line 48 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::offset | ( | SkScalar | dx, |
SkScalar | dy | ||
) |
Definition at line 793 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::operator= | ( | const SkPath & | src | ) |
Definition at line 60 of file SkPathBuilder.cpp.
|
default |
SkPathBuilder & SkPathBuilder::polylineTo | ( | const SkPoint | pts[], |
int | count | ||
) |
Definition at line 779 of file SkPathBuilder.cpp.
|
inline |
Definition at line 79 of file SkPathBuilder.h.
|
inline |
Definition at line 57 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::quadTo | ( | SkPoint | pt1, |
SkPoint | pt2 | ||
) |
Definition at line 117 of file SkPathBuilder.cpp.
|
inline |
Definition at line 54 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::rConicTo | ( | SkPoint | p1, |
SkPoint | p2, | ||
SkScalar | w | ||
) |
Definition at line 180 of file SkPathBuilder.cpp.
|
inline |
Definition at line 92 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::rCubicTo | ( | SkPoint | pt1, |
SkPoint | pt2, | ||
SkPoint | pt3 | ||
) |
|
inline |
Definition at line 96 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::reset | ( | ) |
Definition at line 43 of file SkPathBuilder.cpp.
SkPathBuilder & SkPathBuilder::rLineTo | ( | SkPoint | pt | ) |
Definition at line 169 of file SkPathBuilder.cpp.
|
inline |
Definition at line 86 of file SkPathBuilder.h.
SkPathBuilder & SkPathBuilder::rQuadTo | ( | SkPoint | pt1, |
SkPoint | pt2 | ||
) |
|
inline |
Definition at line 88 of file SkPathBuilder.h.
|
inline |
Definition at line 42 of file SkPathBuilder.h.
|
inline |
Definition at line 43 of file SkPathBuilder.h.
SkPath SkPathBuilder::snapshot | ( | ) | const |
Definition at line 232 of file SkPathBuilder.cpp.
|
inline |
Definition at line 225 of file SkPathBuilder.h.
|
friend |
Definition at line 267 of file SkPathBuilder.h.