Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1497283002: use RawIter in hairpath (simplifies) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScan_Hairline.cpp
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 7a6e3ba1874e9c9c5ccd467e3ded73243d9b4ebe..3917081571f3352219599a2e35acfb59edb6957f 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698