blob: f40611615bb2ce1fdf6e2820f4cdbe5c9c8a2509 [file] [log] [blame]
caryclark@google.com9e49fb62012-08-27 14:11:33 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
caryclark@google.com27accef2012-01-25 18:57:23 +00007#include "CubicIntersection_TestData.h"
8#include "Intersection_Tests.h"
9
10void cubecode_test(int test);
caryclark@google.combeda3892013-02-07 13:13:41 +000011void parseSVG();
caryclark@google.com27accef2012-01-25 18:57:23 +000012
caryclark@google.comfa0588f2012-04-26 21:01:06 +000013#define TEST_QUADS_FIRST 0
caryclark@google.com78e17132012-04-17 11:40:34 +000014
caryclark@google.com27accef2012-01-25 18:57:23 +000015void Intersection_Tests() {
caryclark@google.com24bec792012-08-20 12:43:57 +000016 int testsRun = 0;
caryclark@google.comf9502d72013-02-04 14:06:49 +000017 CubicIntersection_IntersectionFinder();
caryclark@google.com47d73da2013-02-17 01:41:25 +000018 CubicIntersection_NewOneOffTest();
caryclark@google.comc83c70e2013-02-22 21:50:07 +000019#if 0
caryclark@google.comd4c8e1e2013-03-05 14:13:13 +000020 CubicIntersection_SelfTest();
21 QuadraticIntersection_IntersectionFinder();
22 QuadraticIntersection_OneOffTest();
caryclark@google.comc83c70e2013-02-22 21:50:07 +000023#endif
caryclark@google.com47d73da2013-02-17 01:41:25 +000024 SimplifyNew_Test();
25 CubicsToQuadratics_OneOffTest();
caryclark@google.com73ca6242013-01-17 21:02:47 +000026 CubicIntersection_OneOffTest();
caryclark@google.com5e0500f2013-02-20 12:51:37 +000027// CubicIntersection_OneOffTests();
caryclark@google.combeda3892013-02-07 13:13:41 +000028 #if 0
29 parseSVG();
30 #endif
caryclark@google.com45a8fc62013-02-14 15:29:11 +000031// QuadraticIntersection_PointFinder();
caryclark@google.comaa358312013-01-29 20:28:49 +000032 ShapeOps4x4CubicsThreaded_Test(testsRun);
33 CubicToQuadratics_Test();
caryclark@google.com85ec74c2013-01-28 19:25:51 +000034 QuadraticIntersection_Test();
caryclark@google.com9f602912013-01-24 21:47:16 +000035 QuarticRoot_Test();
36 CubicIntersection_RandTest();
caryclark@google.comd68bc302013-01-07 13:17:18 +000037 CubicsToQuadratics_RandTest();
caryclark@google.com8f9f4682013-01-03 21:18:16 +000038 Simplify4x4RectsThreaded_Test(testsRun);
caryclark@google.com24bec792012-08-20 12:43:57 +000039 Simplify4x4QuadraticsThreaded_Test(testsRun);
caryclark@google.com03f97062012-08-21 13:13:52 +000040 QuadLineIntersectThreaded_Test(testsRun);
caryclark@google.com24bec792012-08-20 12:43:57 +000041 SimplifyNondegenerate4x4TrianglesThreaded_Test(testsRun);
42 SimplifyDegenerate4x4TrianglesThreaded_Test(testsRun);
43 Simplify4x4QuadralateralsThreaded_Test(testsRun);
caryclark@google.come7bd5f42012-12-13 19:47:53 +000044 ShapeOps4x4RectsThreaded_Test(testsRun);
caryclark@google.com24bec792012-08-20 12:43:57 +000045 SkDebugf("%s total testsRun=%d\n", __FUNCTION__, testsRun);
caryclark@google.come7bd5f42012-12-13 19:47:53 +000046 LineQuadraticIntersection_Test();
47 MiniSimplify_Test();
48 SimplifyAngle_Test();
caryclark@google.com32546db2012-08-31 20:55:07 +000049 QuadraticBezierClip_Test();
caryclark@google.com1577e8f2012-05-22 17:01:14 +000050 SimplifyFindNext_Test();
caryclark@google.comb45a1b42012-05-18 20:50:33 +000051 SimplifyFindTop_Test();
caryclark@google.comb45a1b42012-05-18 20:50:33 +000052 QuadraticReduceOrder_Test();
caryclark@google.comfa0588f2012-04-26 21:01:06 +000053 SimplifyAddIntersectingTs_Test();
rmistry@google.comd6176b02012-08-23 18:14:13 +000054
caryclark@google.com27accef2012-01-25 18:57:23 +000055 cubecode_test(1);
56 convert_testx();
57 // tests are in dependency / complexity order
58 Inline_Tests();
59 ConvexHull_Test();
60 ConvexHull_X_Test();
61
62 LineParameter_Test();
63 LineIntersection_Test();
caryclark@google.com27accef2012-01-25 18:57:23 +000064 LineCubicIntersection_Test();
65
caryclark@google.coma5764232012-03-28 16:20:21 +000066 SimplifyQuadraticPaths_Test();
67
caryclark@google.com4917f172012-03-05 22:01:21 +000068 SimplifyPolygonPaths_Test();
caryclark@google.com2e7f4c82012-03-20 21:11:59 +000069 SimplifyRectangularPaths_Test();
caryclark@google.com4917f172012-03-05 22:01:21 +000070 SimplifyQuadralateralPaths_Test();
caryclark@google.com78e17132012-04-17 11:40:34 +000071
caryclark@google.com45a8fc62013-02-14 15:29:11 +000072 // ActiveEdge_Test();
caryclark@google.comd88e0892012-03-27 13:23:51 +000073
caryclark@google.com27accef2012-01-25 18:57:23 +000074 QuadraticCoincidence_Test();
caryclark@google.com27accef2012-01-25 18:57:23 +000075 QuadraticIntersection_Test();
76
77 CubicParameterization_Test();
78 CubicCoincidence_Test();
79 CubicReduceOrder_Test();
80 CubicBezierClip_Test();
81 CubicIntersection_Test();
caryclark@google.comc6825902012-02-03 22:07:47 +000082
caryclark@google.com27accef2012-01-25 18:57:23 +000083}