Skia
2DGraphicsLibrary
|
Iterate through all of the segments (lines, quadratics, cubics) of each contours in a path. More...
#include <SkPath.h>
Public Member Functions | |
Iter (const SkPath &, bool forceClose) | |
void | setPath (const SkPath &, bool forceClose) |
Verb | next (SkPoint pts[4], bool doConsumeDegerates=true, bool exact=false) |
Return the next verb in this iteration of the path. More... | |
SkScalar | conicWeight () const |
Return the weight for the current conic. More... | |
bool | isCloseLine () const |
If next() returns kLine_Verb, then this query returns true if the line was the result of a close() command (i.e. More... | |
bool | isClosedContour () const |
Returns true if the current contour is closed (has a kClose_Verb) More... | |
Private Member Functions | |
const SkPoint & | cons_moveTo () |
Verb | autoClose (SkPoint pts[2]) |
void | consumeDegenerateSegments (bool exact) |
Verb | doNext (SkPoint pts[4]) |
Private Attributes | |
const SkPoint * | fPts |
const uint8_t * | fVerbs |
const uint8_t * | fVerbStop |
const SkScalar * | fConicWeights |
SkPoint | fMoveTo |
SkPoint | fLastPt |
SkBool8 | fForceClose |
SkBool8 | fNeedClose |
SkBool8 | fCloseLine |
SkBool8 | fSegmentState |
Iterate through all of the segments (lines, quadratics, cubics) of each contours in a path.
The iterator cleans up the segments along the way, removing degenerate segments and adding close verbs where necessary. When the forceClose argument is provided, each contour (as defined by a new starting move command) will be completed with a close verb regardless of the contour's contents.
|
inline |
Return the weight for the current conic.
Only valid if the current segment return by next() was a conic.
bool SkPath::Iter::isClosedContour | ( | ) | const |
Returns true if the current contour is closed (has a kClose_Verb)
|
inline |
If next() returns kLine_Verb, then this query returns true if the line was the result of a close() command (i.e.
the end point is the initial moveto for this contour). If next() returned a different verb, this returns an undefined value.
|
inline |
Return the next verb in this iteration of the path.
When all segments have been visited, return kDone_Verb.
pts | The points representing the current verb and/or segment |
doConsumeDegerates | If true, first scan for segments that are deemed degenerate (too short) and skip those. |
exact | if doConsumeDegenerates is true and exact is true, skip only degenerate elements with lengths exactly equal to zero. If exact is false, skip degenerate elements with lengths close to zero. If doConsumeDegenerates is false, exact has no effect. |