segments have been visited, return kDone_Verb.
@param pts The points representing the current verb and/or segment
+ @param doConsumeDegerates If true, first scan for segments that are
+ deemed degenerate (too short) and skip those.
@return The verb for the current segment
*/
- Verb next(SkPoint pts[4]);
+ Verb next(SkPoint pts[4], bool doConsumeDegerates = true) {
+ if (doConsumeDegerates) {
+ this->consumeDegenerateSegments();
+ }
+ return this->doNext(pts);
+ }
/** 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
inline const SkPoint& cons_moveTo();
Verb autoClose(SkPoint pts[2]);
void consumeDegenerateSegments();
+ Verb doNext(SkPoint pts[4]);
};
/** Iterate through the verbs in the path, providing the associated points.
setShiftedClip(&clip, *iclip, shiftUp);
SkEdgeClipper clipper;
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kMove_Verb:
case SkPath::kClose_Verb:
}
}
} else {
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kMove_Verb:
case SkPath::kClose_Verb:
SkPoint pts[4];
SkPath::Verb verb;
- while ((verb = iter.next(pts)) != kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != kDone_Verb) {
switch (verb) {
case kMove_Verb:
tmp.moveTo(pts[0]);
}
}
-SkPath::Verb SkPath::Iter::next(SkPoint ptsParam[4]) {
+SkPath::Verb SkPath::Iter::doNext(SkPoint ptsParam[4]) {
SkASSERT(ptsParam);
- this->consumeDegenerateSegments();
if (fVerbs == fVerbStop) {
// Close the curve if requested and if there is some curve to close
SkDebugf("path: forceClose=%s %s\n", forceClose ? "true" : "false",
title ? title : "");
- while ((verb = iter.next(pts)) != kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != kDone_Verb) {
switch (verb) {
case kMove_Verb:
#ifdef SK_CAN_USE_FLOAT
SkScalar top = SkIntToScalar(SK_MaxS16);
SkScalar bot = SkIntToScalar(SK_MinS16);
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
maxEdges += gPathVerbToMaxEdges[verb];
int lastIndex = gPathVerbToInitialLastIndex[verb];
SkPoint pts[4];
SkPath::Verb verb;
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kLine_Verb:
lineproc(pts[0], pts[1], clip, blitter);
SkPoint pts[4];
SkPath::Verb verb, lastSegment = SkPath::kMove_Verb;
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kMove_Verb:
APPLY_PROC(proc, &pts[0], 1);
lastCorner.set(0, 0);
for (;;) {
- switch (verb = iter.next(pts)) {
+ switch (verb = iter.next(pts, false)) {
case SkPath::kMove_Verb:
// close out the previous (open) contour
if (SkPath::kLine_Verb == prevVerb) {
SkPath::Iter iter(path, false);
SkPoint pts[4];
for (;;) {
- switch (iter.next(pts)) {
+ switch (iter.next(pts, false)) {
case SkPath::kMove_Verb:
str->appendf(" M%g,%g", pts[0].fX, pts[0].fY);
break;
SkPoint pts[4];
for (;;) {
- switch (iter.next(pts)) {
+ switch (iter.next(pts, false)) {
case SkPath::kMove_Verb:
append_scalars(&stream, 'M', &pts[0].fX, 2);
break;