/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#include "Test.h"
#include "SkPolyUtils.h"

DEF_TEST(PolyUtils, reporter) {

    SkTDArray<SkPoint> poly;
    // init simple index map
    uint16_t indexMap[256];
    for (int i = 0; i < 256; ++i) {
        indexMap[i] = i;
    }
    SkTDArray<uint16_t> triangleIndices;

    // skinny triangle
    *poly.push() = SkPoint::Make(-100, 55);
    *poly.push() = SkPoint::Make(100, 55);
    *poly.push() = SkPoint::Make(102.5f, 54.330127f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) < 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // switch winding
    poly[2].set(102.5f, 55.330127f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) > 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // make degenerate
    poly[2].set(100 + 2.5f, 55);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) == 0);
    // TODO: should these fail?
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, !SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                          &triangleIndices));

    // giant triangle
    poly[0].set(-1.0e+37f, 1.0e+37f);
    poly[1].set(1.0e+37f, 1.0e+37f);
    poly[2].set(-1.0e+37f, -1.0e+37f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) < 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // teeny triangle
    poly[0].set(-1.0e-38f, 1.0e-38f);
    poly[1].set(-1.0e-38f, -1.0e-38f);
    poly[2].set(1.0e-38f, 1.0e-38f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) == 0);
    // TODO: should these fail?
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, !SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                          &triangleIndices));

    // triangle way off in space (relative to size so we don't completely obliterate values)
    poly[0].set(-100 + 1.0e+9f, 55 - 1.0e+9f);
    poly[1].set(100 + 1.0e+9f, 55 - 1.0e+9f);
    poly[2].set(150 + 1.0e+9f, 100 - 1.0e+9f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) > 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    ///////////////////////////////////////////////////////////////////////
    // round rect
    poly.reset();
    *poly.push() = SkPoint::Make(-100, 55);
    *poly.push() = SkPoint::Make(100, 55);
    *poly.push() = SkPoint::Make(100 + 2.5f, 50 + 4.330127f);
    *poly.push() = SkPoint::Make(100 + 3.535534f, 50 + 3.535534f);
    *poly.push() = SkPoint::Make(100 + 4.330127f, 50 + 2.5f);
    *poly.push() = SkPoint::Make(105, 50);
    *poly.push() = SkPoint::Make(105, -50);
    *poly.push() = SkPoint::Make(100 + 4.330127f, -50 - 2.5f);
    *poly.push() = SkPoint::Make(100 + 3.535534f, -50 - 3.535534f);
    *poly.push() = SkPoint::Make(100 + 2.5f, -50 - 4.330127f);
    *poly.push() = SkPoint::Make(100, -55);
    *poly.push() = SkPoint::Make(-100, -55);
    *poly.push() = SkPoint::Make(-100 - 2.5f, -50 - 4.330127f);
    *poly.push() = SkPoint::Make(-100 - 3.535534f, -50 - 3.535534f);
    *poly.push() = SkPoint::Make(-100 - 4.330127f, -50 - 2.5f);
    *poly.push() = SkPoint::Make(-105, -50);
    *poly.push() = SkPoint::Make(-105, 50);
    *poly.push() = SkPoint::Make(-100 - 4.330127f, 50 + 2.5f);
    *poly.push() = SkPoint::Make(-100 - 3.535534f, 50 + 3.535534f);
    *poly.push() = SkPoint::Make(-100 - 2.5f, 50 + 4.330127f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) < 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // translate far enough to obliterate some low bits
    for (int i = 0; i < poly.count(); ++i) {
        poly[i].offset(1.0e+7f, 1.0e+7f);
    }
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) < 0);
    // Due to floating point error it's no longer convex
    REPORTER_ASSERT(reporter, !SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                          &triangleIndices));

    // translate a little farther to create some coincident vertices
    for (int i = 0; i < poly.count(); ++i) {
        poly[i].offset(4.0e+7f, 4.0e+7f);
    }
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) < 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    // These can't handle coincident vertices
    REPORTER_ASSERT(reporter, !SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, !SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                          &triangleIndices));

    // troublesome case -- clipped roundrect
    poly.reset();
    *poly.push() = SkPoint::Make(335.928101f, 428.219055f);
    *poly.push() = SkPoint::Make(330.414459f, 423.034912f);
    *poly.push() = SkPoint::Make(325.749084f, 417.395508f);
    *poly.push() = SkPoint::Make(321.931946f, 411.300842f);
    *poly.push() = SkPoint::Make(318.963074f, 404.750977f);
    *poly.push() = SkPoint::Make(316.842468f, 397.745850f);
    *poly.push() = SkPoint::Make(315.570068f, 390.285522f);
    *poly.push() = SkPoint::Make(315.145966f, 382.369965f);
    *poly.push() = SkPoint::Make(315.570068f, 374.454346f);
    *poly.push() = SkPoint::Make(316.842468f, 366.994019f);
    *poly.push() = SkPoint::Make(318.963074f, 359.988892f);
    *poly.push() = SkPoint::Make(321.931946f, 353.439056f);
    *poly.push() = SkPoint::Make(325.749084f, 347.344421f);
    *poly.push() = SkPoint::Make(330.414459f, 341.705017f);
    *poly.push() = SkPoint::Make(335.928101f, 336.520813f);
    *poly.push() = SkPoint::Make(342.289948f, 331.791901f);
    *poly.push() = SkPoint::Make(377.312134f, 331.791901f);
    *poly.push() = SkPoint::Make(381.195313f, 332.532593f);
    *poly.push() = SkPoint::Make(384.464935f, 334.754700f);
    *poly.push() = SkPoint::Make(386.687042f, 338.024292f);
    *poly.push() = SkPoint::Make(387.427765f, 341.907532f);
    *poly.push() = SkPoint::Make(387.427765f, 422.832367f);
    *poly.push() = SkPoint::Make(386.687042f, 426.715576f);
    *poly.push() = SkPoint::Make(384.464935f, 429.985168f);
    *poly.push() = SkPoint::Make(381.195313f, 432.207275f);
    *poly.push() = SkPoint::Make(377.312134f, 432.947998f);
    *poly.push() = SkPoint::Make(342.289948f, 432.947998f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) > 0);
    REPORTER_ASSERT(reporter, SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // a star is born
    poly.reset();
    *poly.push() = SkPoint::Make(0.0f, -50.0f);
    *poly.push() = SkPoint::Make(14.43f, -25.0f);
    *poly.push() = SkPoint::Make(43.30f, -25.0f);
    *poly.push() = SkPoint::Make(28.86f, 0.0f);
    *poly.push() = SkPoint::Make(43.30f, 25.0f);
    *poly.push() = SkPoint::Make(14.43f, 25.0f);
    *poly.push() = SkPoint::Make(0.0f, 50.0f);
    *poly.push() = SkPoint::Make(-14.43f, 25.0f);
    *poly.push() = SkPoint::Make(-43.30f, 25.0f);
    *poly.push() = SkPoint::Make(-28.86f, 0.0f);
    *poly.push() = SkPoint::Make(-43.30f, -25.0f);
    *poly.push() = SkPoint::Make(-14.43f, -25.0f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) > 0);
    REPORTER_ASSERT(reporter, !SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // self-intersecting polygon
    poly.reset();
    *poly.push() = SkPoint::Make(0.0f, -50.0f);
    *poly.push() = SkPoint::Make(14.43f, -25.0f);
    *poly.push() = SkPoint::Make(43.30f, -25.0f);
    *poly.push() = SkPoint::Make(-28.86f, 0.0f);
    *poly.push() = SkPoint::Make(43.30f, 25.0f);
    *poly.push() = SkPoint::Make(14.43f, 25.0f);
    *poly.push() = SkPoint::Make(0.0f, 50.0f);
    *poly.push() = SkPoint::Make(-14.43f, 25.0f);
    *poly.push() = SkPoint::Make(-43.30f, 25.0f);
    *poly.push() = SkPoint::Make(28.86f, 0.0f);
    *poly.push() = SkPoint::Make(-43.30f, -25.0f);
    *poly.push() = SkPoint::Make(-14.43f, -25.0f);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) > 0);
    REPORTER_ASSERT(reporter, !SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, !SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    // running this just to make sure it doesn't crash
    // the fact that it succeeds doesn't mean anything since the input is not simple
    REPORTER_ASSERT(reporter, SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                         &triangleIndices));

    // self-intersecting polygon with coincident point
    poly.reset();
    *poly.push() = SkPoint::Make(0.0f, 0.0f);
    *poly.push() = SkPoint::Make(-50, -50);
    *poly.push() = SkPoint::Make(50, -50);
    *poly.push() = SkPoint::Make(0.00000001f, -0.00000001f);
    *poly.push() = SkPoint::Make(-50, 50);
    *poly.push() = SkPoint::Make(50, 50);
    REPORTER_ASSERT(reporter, SkGetPolygonWinding(poly.begin(), poly.count()) == 0);
    REPORTER_ASSERT(reporter, !SkIsConvexPolygon(poly.begin(), poly.count()));
    REPORTER_ASSERT(reporter, !SkIsSimplePolygon(poly.begin(), poly.count()));
    triangleIndices.reset();
    // running this just to make sure it doesn't crash
    REPORTER_ASSERT(reporter, !SkTriangulateSimplePolygon(poly.begin(), indexMap, poly.count(),
                                                          &triangleIndices));
}
