Index: src/core/SkGeometry.cpp |
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp |
index 5d181a3a20ae045598765a7b64be4c7340408781..8fa905c3a7e3a96b5a1f84e00fea79d5f1bf585e 100644 |
--- a/src/core/SkGeometry.cpp |
+++ b/src/core/SkGeometry.cpp |
@@ -1170,9 +1170,18 @@ static SkPoint* subdivide(const SkConic& src, SkPoint pts[], int level) { |
int SkConic::chopIntoQuadsPOW2(SkPoint pts[], int pow2) const { |
SkASSERT(pow2 >= 0); |
+ const int quadCount = 1 << pow2; |
+ const int ptCount = 2 * quadCount + 1; |
*pts = fPts[0]; |
SkDEBUGCODE(SkPoint* endPts =) subdivide(*this, pts + 1, pow2); |
- SkASSERT(endPts - pts == (2 * (1 << pow2) + 1)); |
+ SkASSERT(endPts - pts == ptCount); |
+ if (!SkPointsAreFinite(pts, ptCount)) { |
+ // if we generated a non-finite, pin ourselves to the middle of the hull, |
+ // as our first and last are already on the first/last pts of th ehull. |
caryclark
2016/07/13 15:33:37
th ehull typo
reed1
2016/07/13 15:55:25
Done.
|
+ for (int i = 1; i < ptCount - 1; ++i) { |
+ pts[i] = fPts[1]; |
+ } |
+ } |
return 1 << pow2; |
} |