Add ear-clipping code to triangulate simple polygons.
Use this to fill concave shadows.
Bug: skia:7971
Change-Id: I63dc1ed845f9fa3fcd86f1ad13b03da23cae0313
Reviewed-on: https://skia-review.googlesource.com/135200
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tests/OffsetSimplePolyTest.cpp b/tests/OffsetSimplePolyTest.cpp
index de720b5..547dc9e 100644
--- a/tests/OffsetSimplePolyTest.cpp
+++ b/tests/OffsetSimplePolyTest.cpp
@@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "Test.h"
-#include "SkOffsetPolygon.h"
+#include "SkPolyUtils.h"
static bool is_convex(const SkTDArray<SkPoint>& poly) {
if (poly.count() < 3) {
@@ -200,10 +200,7 @@
*intersectingPoly.push() = SkPoint::Make(-43.30f, -25.0f);
*intersectingPoly.push() = SkPoint::Make(-14.43f, -25.0f);
- result = SkOffsetSimplePolygon(&intersectingPoly[0], intersectingPoly.count(), -100,
- &offsetPoly);
+ // SkOffsetSimplePolygon now assumes that the input is simple, so we'll just check for that
+ result = SkIsSimplePolygon(&intersectingPoly[0], intersectingPoly.count());
REPORTER_ASSERT(reporter, !result);
-
-
-
}