aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPath.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkPath.h')
-rw-r--r--include/core/SkPath.h94
1 files changed, 49 insertions, 45 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 85f22b5cab..ef8f912d3d 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -6,7 +6,7 @@
*/
/* Generated by tools/bookmaker from include/core/SkPath.h and docs/SkPath_Reference.bmh
- on 2018-06-14 13:13:34. Additional documentation and examples can be found at:
+ on 2018-07-13 08:15:11. Additional documentation and examples can be found at:
https://skia.org/user/api/SkPath_Reference
You may edit either file directly. Structural changes to public interfaces require
@@ -66,14 +66,15 @@ public:
kCCW_Direction, //!< contour travels counterclockwise
};
- /** By default, SkPath has no verbs, no SkPoint, and no weights.
+ /** Constucts an empty path. By default, SkPath has no verbs, no SkPoint, and no weights.
SkPath::FillType is set to kWinding_FillType.
@return empty SkPath
*/
SkPath();
- /** Copy constructor makes two paths identical by value. Internally, path and
+ /** Constructs a copy of an existing path.
+ Copy constructor makes two paths identical by value. Internally, path and
the returned result share pointer values. The underlying verb array, SkPoint array
and weights are copied when modified.
@@ -90,7 +91,8 @@ public:
*/
~SkPath();
- /** SkPath assignment makes two paths identical by value. Internally, assignment
+ /** Constructs a copy of an existing path.
+ SkPath assignment makes two paths identical by value. Internally, assignment
shares pointer values. The underlying verb array, SkPoint array and weights
are copied when modified.
@@ -123,7 +125,7 @@ public:
return !(a == b);
}
- /** Return true if SkPath contain equal verbs and equal weights.
+ /** Returns true if SkPath contain equal verbs and equal weights.
If SkPath contain one or more conics, the weights must match.
conicTo() may add different verbs depending on conic weight, so it is not
@@ -135,7 +137,7 @@ public:
*/
bool isInterpolatable(const SkPath& compare) const;
- /** Interpolate between SkPath with SkPoint array of equal size.
+ /** Interpolates between SkPath with SkPoint array of equal size.
Copy verb array and weights to out, and set out SkPoint array to a weighted
average of this SkPoint array and ending SkPoint array, using the formula: (Path Point * weight) + ending Point * (1 - weight).
@@ -203,7 +205,7 @@ public:
*/
bool isInverseFillType() const { return IsInverseFillType((FillType)fFillType); }
- /** Replace FillType with its inverse. The inverse of FillType describes the area
+ /** Replaces FillType with its inverse. The inverse of FillType describes the area
unmodified by the original FillType.
*/
void toggleInverseFillType() {
@@ -310,7 +312,8 @@ public:
*/
void rewind();
- /** Empty SkPath may have FillType but has no SkPoint, SkPath::Verb, or conic weight.
+ /** Returns if SkPath is empty.
+ Empty SkPath may have FillType but has no SkPoint, SkPath::Verb, or conic weight.
SkPath() constructs empty SkPath; reset() and (rewind) make SkPath empty.
@return true if the path contains no SkPath::Verb array
@@ -320,7 +323,8 @@ public:
return 0 == fPathRef->countVerbs();
}
- /** Contour is closed if SkPath SkPath::Verb array was last modified by close(). When stroked,
+ /** Returns if contour is closed.
+ Contour is closed if SkPath SkPath::Verb array was last modified by close(). When stroked,
closed contour draws SkPaint::Join instead of SkPaint::Cap at first and last SkPoint.
@return true if the last contour ends with a kClose_Verb
@@ -349,7 +353,7 @@ public:
return SkToBool(fIsVolatile);
}
- /** Specify whether SkPath is volatile; whether it will be altered or discarded
+ /** Specifies whether SkPath is volatile; whether it will be altered or discarded
by the caller after it is drawn. SkPath by default have volatile set false, allowing
SkBaseDevice to attach a cache of data which speeds repeated drawing.
@@ -368,7 +372,7 @@ public:
fIsVolatile = isVolatile;
}
- /** Test if line between SkPoint pair is degenerate.
+ /** Tests if line between SkPoint pair is degenerate.
Line with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -382,7 +386,7 @@ public:
*/
static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact);
- /** Test if quad is degenerate.
+ /** Tests if quad is degenerate.
Quad with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -396,7 +400,7 @@ public:
static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2,
const SkPoint& p3, bool exact);
- /** Test if cubic is degenerate.
+ /** Tests if cubic is degenerate.
Cubic with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -489,7 +493,7 @@ public:
return fPathRef->getBounds();
}
- /** Update internal bounds so that subsequent calls to getBounds() are instantaneous.
+ /** Updates internal bounds so that subsequent calls to getBounds() are instantaneous.
Unaltered copies of SkPath may also access cached bounds through getBounds().
For now, identical to calling getBounds() and ignoring the returned value.
@@ -532,7 +536,7 @@ public:
*/
bool conservativelyContainsRect(const SkRect& rect) const;
- /** grows SkPath verb array and SkPoint array to contain extraPtCount additional SkPoint.
+ /** Grows SkPath verb array and SkPoint array to contain extraPtCount additional SkPoint.
May improve performance and use less memory by
reducing the number and size of allocations when creating SkPath.
@@ -779,7 +783,7 @@ public:
void rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2,
SkScalar x3, SkScalar y3);
- /** Append arc to SkPath. Arc added is part of ellipse
+ /** Appends arc to SkPath. 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.
@@ -795,7 +799,7 @@ public:
*/
void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo);
- /** Append arc to SkPath, after appending line if needed. Arc is implemented by conic
+ /** 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 (x0, y0) to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc
is part of circle sized to radius, positioned so it touches both tangent lines.
@@ -808,7 +812,7 @@ public:
*/
void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius);
- /** Append arc to SkPath, after appending line if needed. Arc is implemented by conic
+ /** 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.
@@ -839,7 +843,7 @@ public:
kLarge_ArcSize, //!< larger of arc pair
};
- /** Append arc to SkPath. Arc is implemented by one or more conics weighted to
+ /** Appends arc to SkPath. Arc is implemented by one or more conics weighted to
describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc
curves from last SkPath SkPoint to (x, y), choosing one of four possible routes:
clockwise or counterclockwise, and smaller or larger.
@@ -865,7 +869,7 @@ public:
void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc,
Direction sweep, SkScalar x, SkScalar y);
- /** Append arc to SkPath. Arc is implemented by one or more conic weighted to describe part of oval
+ /** 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.
@@ -890,7 +894,7 @@ public:
this->arcTo(r.fX, r.fY, xAxisRotate, largeArc, sweep, xy.fX, xy.fY);
}
- /** Append arc to SkPath, relative to last SkPath SkPoint. Arc is implemented by one or
+ /** Appends arc to SkPath, relative to last SkPath SkPoint. Arc is implemented by one or
more conic, weighted to describe part of oval with radii (rx, ry) rotated by
xAxisRotate degrees. Arc curves from last SkPath SkPoint (x0, y0) to end SkPoint:
(x0 + dx, y0 + dy), choosing one of four possible routes: clockwise or
@@ -918,7 +922,7 @@ public:
void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc,
Direction sweep, SkScalar dx, SkScalar dy);
- /** Append kClose_Verb to SkPath. A closed contour connects the first and last SkPoint
+ /** Appends kClose_Verb to SkPath. A closed contour connects the first and last SkPoint
with line, forming a continuous loop. Open and closed contour draw the same
with SkPaint::kFill_Style. With SkPaint::kStroke_Style, open contour draws
SkPaint::Cap at contour start and end; closed contour draws
@@ -1013,7 +1017,7 @@ public:
*/
bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const;
- /** Add SkRect to SkPath, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
+ /** Adds SkRect to SkPath, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
starting with top-left corner of SkRect; followed by top-right, bottom-right,
and bottom-left if dir is kCW_Direction; or followed by bottom-left,
bottom-right, and top-right if dir is kCCW_Direction.
@@ -1023,7 +1027,7 @@ public:
*/
void addRect(const SkRect& rect, Direction dir = kCW_Direction);
- /** Add SkRect to SkPath, appending kMove_Verb, three kLine_Verb, and kClose_Verb.
+ /** Adds SkRect to SkPath, appending kMove_Verb, three kLine_Verb, and kClose_Verb.
If dir is kCW_Direction, SkRect corners are added clockwise; if dir is
kCCW_Direction, SkRect corners are added counterclockwise.
start determines the first corner added.
@@ -1034,7 +1038,7 @@ public:
*/
void addRect(const SkRect& rect, Direction dir, unsigned start);
- /** Add SkRect (left, top, right, bottom) to SkPath,
+ /** Adds SkRect (left, top, right, bottom) to SkPath,
appending kMove_Verb, three kLine_Verb, and kClose_Verb,
starting with top-left corner of SkRect; followed by top-right, bottom-right,
and bottom-left if dir is kCW_Direction; or followed by bottom-left,
@@ -1049,7 +1053,7 @@ public:
void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom,
Direction dir = kCW_Direction);
- /** Add oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
+ /** Adds oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
Oval is upright ellipse bounded by SkRect oval with radii equal to half oval width
and half oval height. Oval begins at (oval.fRight, oval.centerY()) and continues
clockwise if dir is kCW_Direction, counterclockwise if dir is kCCW_Direction.
@@ -1059,7 +1063,7 @@ public:
*/
void addOval(const SkRect& oval, Direction dir = kCW_Direction);
- /** Add oval to SkPath, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
+ /** Adds oval to SkPath, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
Oval is upright ellipse bounded by SkRect oval with radii equal to half oval width
and half oval height. Oval begins at start and continues
clockwise if dir is kCW_Direction, counterclockwise if dir is kCCW_Direction.
@@ -1070,7 +1074,7 @@ public:
*/
void addOval(const SkRect& oval, Direction dir, unsigned start);
- /** Add circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,
+ /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,
four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing
clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.
@@ -1084,7 +1088,7 @@ public:
void addCircle(SkScalar x, SkScalar y, SkScalar radius,
Direction dir = kCW_Direction);
- /** Append arc to SkPath, as the start of new contour. Arc added is part of ellipse
+ /** Appends arc to SkPath, 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.
@@ -1099,7 +1103,7 @@ public:
*/
void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle);
- /** Append SkRRect to SkPath, creating a new closed contour. SkRRect has bounds
+ /** Appends SkRRect to SkPath, creating a new closed contour. SkRRect has bounds
equal to rect; each corner is 90 degrees of an ellipse with radii (rx, ry). If
dir is kCW_Direction, SkRRect starts at top-left of the lower-left corner and
winds clockwise. If dir is kCCW_Direction, SkRRect starts at the bottom-left
@@ -1119,7 +1123,7 @@ public:
void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
Direction dir = kCW_Direction);
- /** Append SkRRect to SkPath, creating a new closed contour. SkRRect has bounds
+ /** Appends SkRRect to SkPath, creating a new closed contour. SkRRect has bounds
equal to rect; each corner is 90 degrees of an ellipse with radii from the
array.
@@ -1130,7 +1134,7 @@ public:
void addRoundRect(const SkRect& rect, const SkScalar radii[],
Direction dir = kCW_Direction);
- /** Add rrect to SkPath, creating a new closed contour. If
+ /** Adds rrect to SkPath, creating a new closed contour. If
dir is kCW_Direction, rrect starts at top-left of the lower-left corner and
winds clockwise. If dir is kCCW_Direction, rrect starts at the bottom-left
of the upper-left corner and winds counterclockwise.
@@ -1142,7 +1146,7 @@ public:
*/
void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction);
- /** Add rrect to SkPath, creating a new closed contour. If dir is kCW_Direction, rrect
+ /** Adds rrect to SkPath, creating a new closed contour. If dir is kCW_Direction, rrect
winds clockwise; if dir is kCCW_Direction, rrect winds counterclockwise.
start determines the first point of rrect to add.
@@ -1152,7 +1156,7 @@ public:
*/
void addRRect(const SkRRect& rrect, Direction dir, unsigned start);
- /** Add contour created from line array, adding (count - 1) line segments.
+ /** Adds contour created from line array, adding (count - 1) line segments.
Contour added starts at pts[0], then adds a line for every additional SkPoint
in pts array. If close is true,appends kClose_Verb to SkPath, connecting
pts[count - 1] and pts[0].
@@ -1175,7 +1179,7 @@ public:
kExtend_AddPathMode, //!< add line if prior contour is not closed
};
- /** Append src to SkPath, offset by (dx, dy).
+ /** Appends src to SkPath, offset by (dx, dy).
If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic weights are
added unaltered. If mode is kExtend_AddPathMode, add line before appending
@@ -1189,7 +1193,7 @@ public:
void addPath(const SkPath& src, SkScalar dx, SkScalar dy,
AddPathMode mode = kAppend_AddPathMode);
- /** Append src to SkPath.
+ /** Appends src to SkPath.
If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic weights are
added unaltered. If mode is kExtend_AddPathMode, add line before appending
@@ -1204,7 +1208,7 @@ public:
this->addPath(src, m, mode);
}
- /** Append src to SkPath, transformed by matrix. Transformed curves may have different
+ /** Appends src to SkPath, transformed by matrix. Transformed curves may have different
verbs, SkPoint, and conic weights.
If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic weights are
@@ -1217,14 +1221,14 @@ public:
*/
void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode);
- /** Append src to SkPath, from back to front.
+ /** Appends src to SkPath, from back to front.
Reversed src always appends a new contour to SkPath.
@param src SkPath verbs, SkPoint, and conic weights to add
*/
void reverseAddPath(const SkPath& src);
- /** Offset SkPoint array by (dx, dy). Offset SkPath replaces dst.
+ /** Offsets SkPoint array by (dx, dy). Offset SkPath replaces dst.
If dst is nullptr, SkPath is replaced by offset data.
@param dx offset added to SkPoint array x-axis coordinates
@@ -1233,7 +1237,7 @@ public:
*/
void offset(SkScalar dx, SkScalar dy, SkPath* dst) const;
- /** Offset SkPoint array by (dx, dy). SkPath is replaced by offset data.
+ /** Offsets SkPoint array by (dx, dy). SkPath is replaced by offset data.
@param dx offset added to SkPoint array x-axis coordinates
@param dy offset added to SkPoint array y-axis coordinates
@@ -1242,7 +1246,7 @@ public:
this->offset(dx, dy, this);
}
- /** Transform verb array, SkPoint array, and weight by matrix.
+ /** Transforms verb array, SkPoint array, and weight by matrix.
transform may change verbs and increase their number.
Transformed SkPath replaces dst; if dst is nullptr, original data
is replaced.
@@ -1252,7 +1256,7 @@ public:
*/
void transform(const SkMatrix& matrix, SkPath* dst) const;
- /** Transform verb array, SkPoint array, and weight by matrix.
+ /** Transforms verb array, SkPoint array, and weight by matrix.
transform may change verbs and increase their number.
SkPath is replaced by transformed data.
@@ -1270,7 +1274,7 @@ public:
*/
bool getLastPt(SkPoint* lastPt) const;
- /** Set last point to (x, y). If SkPoint array is empty, append kMove_Verb to
+ /** Sets last point to (x, y). If SkPoint array is empty, append kMove_Verb to
verb array and append (x, y) to SkPoint array.
@param x set x-axis value of last point
@@ -1278,7 +1282,7 @@ public:
*/
void setLastPt(SkScalar x, SkScalar y);
- /** Set the last point on the path. If SkPoint array is empty, append kMove_Verb to
+ /** Sets the last point on the path. If SkPoint array is empty, append kMove_Verb to
verb array and append p to SkPoint array.
@param p set value of last point
@@ -1551,7 +1555,7 @@ public:
*/
size_t writeToMemory(void* buffer) const;
- /** Write SkPath to buffer, returning the buffer written to, wrapped in SkData.
+ /** Writes SkPath to buffer, returning the buffer written to, wrapped in SkData.
serialize() writes SkPath::FillType, verb array, SkPoint array, conic weight, and
additionally writes computed information like SkPath::Convexity and bounds.