diff options
author | Jim Van Verth <jvanverth@google.com> | 2018-06-28 16:26:50 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-29 13:29:57 +0000 |
commit | 8664a1d7d719153e8e854ff0112519d92916cfe2 (patch) | |
tree | 4e0206ed9c734ba40593903ca66930e2df8e39a0 /tests/OffsetSimplePolyTest.cpp | |
parent | a5e703043ff034afea41ea24e9d8f978f05ba678 (diff) |
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>
Diffstat (limited to 'tests/OffsetSimplePolyTest.cpp')
-rw-r--r-- | tests/OffsetSimplePolyTest.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/OffsetSimplePolyTest.cpp b/tests/OffsetSimplePolyTest.cpp index de720b5cf2..547dc9e529 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 @@ DEF_TEST(OffsetSimplePoly, reporter) { *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); - - - } |