diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-03-24 12:10:48 -0400 |
---|---|---|
committer | Jim Van Verth <jvanverth@google.com> | 2017-03-24 16:11:52 +0000 |
commit | dc276f909f3fa20df95f65771d6f6111e64b444a (patch) | |
tree | b837813a807efd70b0d854984c76ec1513f70cd4 /src/utils | |
parent | ab664fa5b5fb96dd1079c090534330ca7e8a10ef (diff) |
Disable convex check for now.
Change-Id: Icd0e14cd8183f19c96eeb9a1c46aed3d7809c29f
Reviewed-on: https://skia-review.googlesource.com/10110
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/utils')
-rwxr-xr-x | src/utils/SkInsetConvexPolygon.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/utils/SkInsetConvexPolygon.cpp b/src/utils/SkInsetConvexPolygon.cpp index 8df7f0efe6..ab6839f627 100755 --- a/src/utils/SkInsetConvexPolygon.cpp +++ b/src/utils/SkInsetConvexPolygon.cpp @@ -141,11 +141,12 @@ bool SkInsetConvexPolygon(const SkPoint* inputPolygonVerts, int inputPolygonSize SkAutoSTMalloc<64, EdgeData> edgeData(inputPolygonSize); for (int i = 0; i < inputPolygonSize; ++i) { - edgeData[i].fValid = true; int j = (i + 1) % inputPolygonSize; inset_edge(inputPolygonVerts[i], inputPolygonVerts[j], insetDistance, winding, &edgeData[i].fInset); + edgeData[i].fIntersection = edgeData[i].fInset.fP0; edgeData[i].fTValue = SK_ScalarMin; + edgeData[i].fValid = true; } int prevIndex = inputPolygonSize - 1; @@ -213,21 +214,21 @@ bool SkInsetConvexPolygon(const SkPoint* inputPolygonVerts, int inputPolygonSize } } -#ifdef SK_DEBUG - bool convex = true; - for (int i = 0; i < insetPolygon->count(); ++i) { - int j = (i + 1) % insetPolygon->count(); - int k = (i + 2) % insetPolygon->count(); - - int side = winding*compute_side((*insetPolygon)[i], (*insetPolygon)[j], - (*insetPolygon)[k]); - if (side < 0) { - convex = false; - break; - } - } - SkASSERT(convex); -#endif +//#ifdef SK_DEBUG +// bool convex = true; +// for (int i = 0; i < insetPolygon->count(); ++i) { +// int j = (i + 1) % insetPolygon->count(); +// int k = (i + 2) % insetPolygon->count(); +// +// int side = winding*compute_side((*insetPolygon)[i], (*insetPolygon)[j], +// (*insetPolygon)[k]); +// if (side < 0) { +// convex = false; +// break; +// } +// } +// SkASSERT(convex); +//#endif return (insetPolygon->count() >= 3); } |