aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_Hairline.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-12-04 11:59:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-04 11:59:05 -0800
commit5123eb760fcb1684394b73c2fc6bfad270b29baf (patch)
treef5dd7f68212e58294d90ecae1993887f0d83df7b /src/core/SkScan_Hairline.cpp
parentc326257a611ba7ced969d9ce04b850b8bb40cdfc (diff)
use RawIter in hairpath (simplifies)
no impact on nanobench BUG=skia: Review URL: https://codereview.chromium.org/1497283002
Diffstat (limited to 'src/core/SkScan_Hairline.cpp')
-rw-r--r--src/core/SkScan_Hairline.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 7a6e3ba187..3917081571 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -374,20 +374,23 @@ static void hair_path(const SkPath& path, const SkRasterClip& rclip, SkBlitter*
}
}
- SkPath::Iter iter(path, false);
- SkPoint pts[4];
- SkPath::Verb verb;
- SkAutoConicToQuads converter;
+ SkPath::RawIter iter(path);
+ SkPoint pts[4], firstPt, lastPt;
+ SkPath::Verb verb;
+ SkAutoConicToQuads converter;
- while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kMove_Verb:
+ firstPt = lastPt = pts[0];
break;
case SkPath::kLine_Verb:
lineproc(pts, 2, clip, blitter);
+ lastPt = pts[1];
break;
case SkPath::kQuad_Verb:
hairquad(pts, clip, blitter, compute_quad_level(pts), lineproc);
+ lastPt = pts[2];
break;
case SkPath::kConic_Verb: {
// how close should the quads be to the original conic?
@@ -399,12 +402,17 @@ static void hair_path(const SkPath& path, const SkRasterClip& rclip, SkBlitter*
hairquad(quadPts, clip, blitter, level, lineproc);
quadPts += 2;
}
+ lastPt = pts[2];
break;
}
case SkPath::kCubic_Verb: {
haircubic(pts, clip, blitter, kMaxCubicSubdivideLevel, lineproc);
+ lastPt = pts[3];
} break;
case SkPath::kClose_Verb:
+ pts[0] = lastPt;
+ pts[1] = firstPt;
+ lineproc(pts, 2, clip, blitter);
break;
case SkPath::kDone_Verb:
break;