never check for degenerates in path::iter
This does not appear to be used externally, and only internally in 3
sites in GPU, which we can handle explicitly.
For now you can still pass bools to Iter::next() but they are ignored.
After this lands, I will update the callers to remove those.
FWIW: none of our other tests or gms seem to notice this change...
Bug: skia:9339
Change-Id: If40077b1ebb3d47cfce0ec43996ff272318e4a62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235104
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/gpu/ops/GrAAConvexTessellator.cpp b/src/gpu/ops/GrAAConvexTessellator.cpp
index 5e545d4..0e753a1 100644
--- a/src/gpu/ops/GrAAConvexTessellator.cpp
+++ b/src/gpu/ops/GrAAConvexTessellator.cpp
@@ -394,19 +394,27 @@
SkPath::Iter iter(path, true);
SkPoint pts[4];
SkPath::Verb verb;
- while ((verb = iter.next(pts, true, true)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
switch (verb) {
case SkPath::kLine_Verb:
- this->lineTo(m, pts[1], kSharp_CurveState);
+ if (!SkPathPriv::AllPointsEq(pts, 2)) {
+ this->lineTo(m, pts[1], kSharp_CurveState);
+ }
break;
case SkPath::kQuad_Verb:
- this->quadTo(m, pts);
+ if (!SkPathPriv::AllPointsEq(pts, 3)) {
+ this->quadTo(m, pts);
+ }
break;
case SkPath::kCubic_Verb:
- this->cubicTo(m, pts);
+ if (!SkPathPriv::AllPointsEq(pts, 4)) {
+ this->cubicTo(m, pts);
+ }
break;
case SkPath::kConic_Verb:
- this->conicTo(m, pts, iter.conicWeight());
+ if (!SkPathPriv::AllPointsEq(pts, 3)) {
+ this->conicTo(m, pts, iter.conicWeight());
+ }
break;
case SkPath::kMove_Verb:
case SkPath::kClose_Verb: