diff options
author | 2012-05-16 17:16:46 +0000 | |
---|---|---|
committer | 2012-05-16 17:16:46 +0000 | |
commit | 4a3b714d73e585a3985d614600c6b79d5c8b1f1e (patch) | |
tree | 84c21a9c3bbe64fdac59b466636080d63a1f5a1a /include/core | |
parent | 292aff6aca8677d5159cc2f7fa2bb933a450f049 (diff) |
Iter::next takes a bool (defaults to true for now) if we want to consume degenerates.
path-filling and stroking pass false, as they already are written to handle
small segments (and it makes next() run 2x faster if you pass false).
Review URL: https://codereview.appspot.com/6214049
git-svn-id: http://skia.googlecode.com/svn/trunk@3974 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPath.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 4453abd482..03108dfd5b 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -684,9 +684,16 @@ public: 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 @@ -717,6 +724,7 @@ public: 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. |