Lines Matching full:reporter
90 static void test_path_to_region(skiatest::Reporter* reporter) {
116 static void test_path_close_issue1474(skiatest::Reporter* reporter) {
129 REPORTER_ASSERT(reporter, 50 == last.fX);
130 REPORTER_ASSERT(reporter, 50 == last.fY);
140 REPORTER_ASSERT(reporter, 75 == last.fX);
141 REPORTER_ASSERT(reporter, 75 == last.fY);
151 REPORTER_ASSERT(reporter, 85 == last.fX);
152 REPORTER_ASSERT(reporter, 85 == last.fY);
162 REPORTER_ASSERT(reporter, 95 == last.fX);
163 REPORTER_ASSERT(reporter, 95 == last.fY);
166 static void test_android_specific_behavior(skiatest::Reporter* reporter) {
174 REPORTER_ASSERT(reporter, original.getSourcePath() == &source);
180 REPORTER_ASSERT(reporter, copy.getGenerationID() == original.getGenerationID());
181 REPORTER_ASSERT(reporter, copy.getSourcePath() == original.getSourcePath());
187 REPORTER_ASSERT(reporter, assign.getGenerationID() != assignID);
188 REPORTER_ASSERT(reporter, assign.getSourcePath() == original.getSourcePath());
193 REPORTER_ASSERT(reporter, copy.getGenerationID() != copyID);
194 REPORTER_ASSERT(reporter, copy.getSourcePath() == original.getSourcePath());
199 REPORTER_ASSERT(reporter, assign.getGenerationID() != assignID);
200 REPORTER_ASSERT(reporter, assign.getSourcePath() == original.getSourcePath());
210 REPORTER_ASSERT(reporter, copy.getGenerationID() != copyID);
211 REPORTER_ASSERT(reporter, assign.getGenerationID() != assignID);
212 REPORTER_ASSERT(reporter, copy.getSourcePath() == original.getSourcePath());
213 REPORTER_ASSERT(reporter, assign.getSourcePath() == &anotherSource);
217 static void test_gen_id(skiatest::Reporter* reporter) {
219 REPORTER_ASSERT(reporter, a.getGenerationID() == b.getGenerationID());
223 REPORTER_ASSERT(reporter, z != b.getGenerationID());
226 REPORTER_ASSERT(reporter, a.getGenerationID() == b.getGenerationID());
230 REPORTER_ASSERT(reporter, z != y);
234 REPORTER_ASSERT(reporter, x != y && x != z);
237 REPORTER_ASSERT(reporter, b.getGenerationID() == y && a.getGenerationID() == x);
240 REPORTER_ASSERT(reporter, b.getGenerationID() == x);
243 REPORTER_ASSERT(reporter, c.getGenerationID() == x);
247 REPORTER_ASSERT(reporter, b.getGenerationID() == x);
248 REPORTER_ASSERT(reporter, a.getGenerationID() == x);
249 REPORTER_ASSERT(reporter, w != x);
259 REPORTER_ASSERT(reporter, (v == w) == kExpectGenIDToIgnoreFill);
262 REPORTER_ASSERT(reporter, v != c.getGenerationID());
403 static void test_addrect(skiatest::Reporter* reporter) {
407 REPORTER_ASSERT(reporter, path.isRect(NULL));
412 REPORTER_ASSERT(reporter, !path.isRect(NULL));
417 REPORTER_ASSERT(reporter, !path.isRect(NULL));
422 REPORTER_ASSERT(reporter, !path.isRect(NULL));
427 REPORTER_ASSERT(reporter, !path.isRect(NULL));
431 static void test_addrect_isfinite(skiatest::Reporter* reporter) {
435 REPORTER_ASSERT(reporter, path.isFinite());
439 REPORTER_ASSERT(reporter, !path.isFinite());
442 REPORTER_ASSERT(reporter, !path.isFinite());
445 REPORTER_ASSERT(reporter, path.isFinite());
448 REPORTER_ASSERT(reporter, path.isFinite());
516 static void test_isfinite_after_transform(skiatest::Reporter* reporter) {
529 REPORTER_ASSERT(reporter, path.getBounds().isFinite());
530 REPORTER_ASSERT(reporter, !path.getBounds().isEmpty());
533 REPORTER_ASSERT(reporter, path.getBounds().isEmpty());
538 REPORTER_ASSERT(reporter, !path.isFinite());
539 REPORTER_ASSERT(reporter, path.getBounds().isEmpty());
586 static void test_arb_round_rect_is_convex(skiatest::Reporter* reporter) {
605 REPORTER_ASSERT(reporter, temp.isConvex());
613 static void test_arb_zero_rad_round_rect_is_rect(skiatest::Reporter* reporter) {
633 REPORTER_ASSERT(reporter, temp.isRect(&result));
634 REPORTER_ASSERT(reporter, r == result);
638 static void test_rect_isfinite(skiatest::Reporter* reporter) {
645 REPORTER_ASSERT(reporter, r.isFinite());
647 REPORTER_ASSERT(reporter, !r.isFinite());
649 REPORTER_ASSERT(reporter, !r.isFinite());
658 REPORTER_ASSERT(reporter, isFine);
659 REPORTER_ASSERT(reporter, !r.isEmpty());
663 REPORTER_ASSERT(reporter, !isFine);
664 REPORTER_ASSERT(reporter, r.isEmpty());
668 REPORTER_ASSERT(reporter, !isFine);
669 REPORTER_ASSERT(reporter, r.isEmpty());
672 static void test_path_isfinite(skiatest::Reporter* reporter) {
678 REPORTER_ASSERT(reporter, path.isFinite());
681 REPORTER_ASSERT(reporter, path.isFinite());
685 REPORTER_ASSERT(reporter, path.isFinite());
689 REPORTER_ASSERT(reporter, !path.isFinite());
693 REPORTER_ASSERT(reporter, !path.isFinite());
696 static void test_isfinite(skiatest::Reporter* reporter) {
697 test_rect_isfinite(reporter);
698 test_path_isfinite(reporter);
708 static void test_poly(skiatest::Reporter* reporter, const SkPath& path,
718 REPORTER_ASSERT(reporter, firstTime);
719 REPORTER_ASSERT(reporter, pts[0] == srcPts[0]);
724 REPORTER_ASSERT(reporter, !firstTime);
725 REPORTER_ASSERT(reporter, pts[1] == srcPts[0]);
729 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected quad verb");
732 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected conic verb");
735 REPORTER_ASSERT_MESSAGE(reporter, false, "unexpected cubic verb");
738 REPORTER_ASSERT(reporter, !firstTime);
739 REPORTER_ASSERT(reporter, !foundClose);
740 REPORTER_ASSERT(reporter, expectClose);
748 REPORTER_ASSERT(reporter, foundClose == expectClose);
751 static void test_addPoly(skiatest::Reporter* reporter) {
764 test_poly(reporter, path, pts, SkToBool(doClose));
769 static void test_strokerec(skiatest::Reporter* reporter) {
771 REPORTER_ASSERT(reporter, rec.isFillStyle());
774 REPORTER_ASSERT(reporter, rec.isHairlineStyle());
777 REPORTER_ASSERT(reporter, SkStrokeRec::kStroke_Style == rec.getStyle());
780 REPORTER_ASSERT(reporter, SkStrokeRec::kStrokeAndFill_Style == rec.getStyle());
783 REPORTER_ASSERT(reporter, SkStrokeRec::kHairline_Style == rec.getStyle());
786 REPORTER_ASSERT(reporter, SkStrokeRec::kFill_Style == rec.getStyle());
793 static void check_direction(skiatest::Reporter* reporter, const SkPath& path,
802 REPORTER_ASSERT(reporter, dir == expected);
804 REPORTER_ASSERT(reporter, SkPath::kUnknown_Direction == expected);
808 static void test_direction(skiatest::Reporter* reporter) {
811 REPORTER_ASSERT(reporter, !path.cheapComputeDirection(NULL));
812 REPORTER_ASSERT(reporter, !path.cheapIsDirection(SkPath::kCW_Direction));
813 REPORTER_ASSERT(reporter, !path.cheapIsDirection(SkPath::kCCW_Direction));
814 REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kUnknown_Direction));
827 REPORTER_ASSERT(reporter, valid);
828 REPORTER_ASSERT(reporter, !path.cheapComputeDirection(NULL));
843 REPORTER_ASSERT(reporter, valid);
844 check_direction(reporter, path, SkPath::kCW_Direction);
859 REPORTER_ASSERT(reporter, valid);
860 check_direction(reporter, path, SkPath::kCCW_Direction);
868 check_direction(reporter, path, SkPath::kCW_Direction);
873 check_direction(reporter, path, SkPath::kCCW_Direction);
881 check_direction(reporter, path, SkPath::kCCW_Direction);
886 check_direction(reporter, path, SkPath::kCW_Direction);
892 REPORTER_ASSERT(reporter, SkPath::kConvex_Convexity == path.getConvexity());
893 check_direction(reporter, path, SkPath::kCCW_Direction);
904 static void test_bounds(skiatest::Reporter* reporter) {
918 REPORTER_ASSERT(reporter, path0.getBounds() == path1.getBounds());
957 static void check_close(skiatest::Reporter* reporter, const SkPath& path) {
973 REPORTER_ASSERT(reporter, mv == pts[0]);
982 REPORTER_ASSERT(reporter, !i || nMT == nCL);
986 static void test_close(skiatest::Reporter* reporter) {
990 check_close(reporter, closePt);
994 check_close(reporter, openPt);
997 check_close(reporter, empty);
999 check_close(reporter, empty);
1003 check_close(reporter, rect);
1005 check_close(reporter, rect);
1009 check_close(reporter, quad);
1011 check_close(reporter, quad);
1016 check_close(reporter, cubic);
1018 check_close(reporter, cubic);
1023 check_close(reporter, line);
1025 check_close(reporter, line);
1031 check_close(reporter, rect2);
1033 check_close(reporter, rect2);
1039 check_close(reporter, oval3);
1041 check_close(reporter, oval3);
1048 check_close(reporter, moves);
1053 static void check_convexity(skiatest::Reporter* reporter, const SkPath& path,
1057 REPORTER_ASSERT(reporter, c == expected);
1060 static void test_convexity2(skiatest::Reporter* reporter) {
1064 check_convexity(reporter, pt, SkPath::kConvex_Convexity);
1065 check_direction(reporter, pt, SkPath::kUnknown_Direction);
1071 check_convexity(reporter, line, SkPath::kConvex_Convexity);
1072 check_direction(reporter, line, SkPath::kUnknown_Direction);
1079 check_convexity(reporter, triLeft, SkPath::kConvex_Convexity);
1080 check_direction(reporter, triLeft, SkPath::kCW_Direction);
1087 check_convexity(reporter, triRight, SkPath::kConvex_Convexity);
1088 check_direction(reporter, triRight, SkPath::kCCW_Direction);
1096 check_convexity(reporter, square, SkPath::kConvex_Convexity);
1097 check_direction(reporter, square, SkPath::kCW_Direction);
1113 check_convexity(reporter, redundantSquare, SkPath::kConvex_Convexity);
1114 check_direction(reporter, redundantSquare, SkPath::kCW_Direction);
1130 check_convexity(reporter, bowTie, SkPath::kConcave_Convexity);
1131 check_direction(reporter, bowTie, kDontCheckDir);
1142 check_convexity(reporter, spiral, SkPath::kConcave_Convexity);
1143 check_direction(reporter, spiral, kDontCheckDir);
1152 check_convexity(reporter, dent, SkPath::kConcave_Convexity);
1153 check_direction(reporter, dent, SkPath::kCW_Direction);
1169 check_convexity(reporter, strokedSin, SkPath::kConcave_Convexity);
1170 check_direction(reporter, strokedSin, kDontCheckDir);
1173 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,
1175 REPORTER_ASSERT(reporter, p.isConvex());
1176 REPORTER_ASSERT(reporter, p.getBounds() == bounds);
1179 REPORTER_ASSERT(reporter, p2.isConvex());
1180 REPORTER_ASSERT(reporter, p2.getBounds() == bounds);
1184 REPORTER_ASSERT(reporter, other.isConvex());
1185 REPORTER_ASSERT(reporter, other.getBounds() == bounds);
1207 static void test_convexity(skiatest::Reporter* reporter) {
1210 check_convexity(reporter, path, SkPath::kConvex_Convexity);
1212 check_convexity(reporter, path, SkPath::kConvex_Convexity);
1214 check_convexity(reporter, path, SkPath::kConcave_Convexity);
1218 check_convexity(reporter, path, SkPath::kConvex_Convexity);
1219 REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCCW_Direction));
1223 check_convexity(reporter, path, SkPath::kConvex_Convexity);
1224 REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCW_Direction));
1244 check_convexity(reporter, path, gRec[i].fExpectedConvexity);
1245 check_direction(reporter, path, gRec[i].fExpectedDirection);
1251 REPORTER_ASSERT(reporter, (gRec[i].fExpectedDirection == SkPath::kUnknown_Direction)
1253 REPORTER_ASSERT(reporter, !foundDir || gRec[i].fExpectedDirection == dir);
1254 check_convexity(reporter, copy, gRec[i].fExpectedConvexity);
1256 REPORTER_ASSERT(reporter, gRec[i].fExpectedConvexity == path.getConvexity());
1257 check_direction(reporter, path, gRec[i].fExpectedDirection);
1261 static void test_isLine(skiatest::Reporter* reporter) {
1266 REPORTER_ASSERT(reporter, !path.isLine(NULL));
1271 REPORTER_ASSERT(reporter, !path.isLine(pts));
1273 REPORTER_ASSERT(reporter, pts[0].equals(value, value));
1274 REPORTER_ASSERT(reporter, pts[1].equals(value, value));
1278 REPORTER_ASSERT(reporter, value != moveX && value != moveY);
1281 REPORTER_ASSERT(reporter, !path.isLine(NULL));
1282 REPORTER_ASSERT(reporter, !path.isLine(pts));
1284 REPORTER_ASSERT(reporter, pts[0].equals(value, value));
1285 REPORTER_ASSERT(reporter, pts[1].equals(value, value));
1289 REPORTER_ASSERT(reporter, value != lineX && value != lineY);
1292 REPORTER_ASSERT(reporter, path.isLine(NULL));
1294 REPORTER_ASSERT(reporter, !pts[0].equals(moveX, moveY));
1295 REPORTER_ASSERT(reporter, !pts[1].equals(lineX, lineY));
1296 REPORTER_ASSERT(reporter, path.isLine(pts));
1297 REPORTER_ASSERT(reporter, pts[0].equals(moveX, moveY));
1298 REPORTER_ASSERT(reporter, pts[1].equals(lineX, lineY));
1301 REPORTER_ASSERT(reporter, !path.isLine(NULL));
1302 REPORTER_ASSERT(reporter, !path.isLine(pts));
1303 REPORTER_ASSERT(reporter, pts[0].equals(moveX, moveY));
1304 REPORTER_ASSERT(reporter, pts[1].equals(lineX, lineY));
1308 REPORTER_ASSERT(reporter, !path.isLine(NULL));
1311 static void test_conservativelyContains(skiatest::Reporter* reporter) {
1414 REPORTER_ASSERT(reporter, kQueries[q].fInRect ==
1419 REPORTER_ASSERT(reporter, kQueries[q].fInCircle ==
1424 REPORTER_ASSERT(reporter, kQueries[q].fInRR ==
1436 REPORTER_ASSERT(reporter, kQueries[q].fInCubicRR ==
1448 REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(qRect));
1459 REPORTER_ASSERT(reporter, path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(50), 0,
1463 REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(
1469 REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(-10),
1475 REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(10),
1487 REPORTER_ASSERT(reporter, path.conservativelyContainsRect(SkRect::MakeXYWH(SkIntToScalar(50), 0,
1493 REPORTER_ASSERT(reporter, !path.conservativelyContainsRect(SkRect::MakeXYWH(0, 0, 1, 1)));
1496 static void test_isRect_open_close(skiatest::Reporter* reporter) {
1503 REPORTER_ASSERT(reporter, path.isRect(NULL, NULL));
1504 REPORTER_ASSERT(reporter, path.isRect(&isClosed, NULL));
1505 REPORTER_ASSERT(reporter, isClosed);
1506 REPORTER_ASSERT(reporter, SkPath::kStroke_PathAsRect == path.asRect(NULL));
1511 static void test_isRect(skiatest::Reporter* reporter) {
1512 test_isRect_open_close(reporter);
1609 REPORTER_ASSERT(reporter, tests[testIndex].fIsRect == path.isRect(NULL));
1610 REPORTER_ASSERT(reporter, tests[testIndex].fIsRect == path.isRect(NULL, NULL));
1615 REPORTER_ASSERT(reporter, path.isRect(&computed));
1616 REPORTER_ASSERT(reporter, expected == computed);
1620 REPORTER_ASSERT(reporter, path.cheapComputeDirection(&cheapDirection));
1621 REPORTER_ASSERT(reporter, path.isRect(&isClosed, &direction));
1622 REPORTER_ASSERT(reporter, isClosed == tests[testIndex].fClose);
1623 REPORTER_ASSERT(reporter, direction == cheapDirection);
1626 REPORTER_ASSERT(reporter, SkPath::kFill_PathAsRect == path.asRect());
1627 REPORTER_ASSERT(reporter, SkPath::kFill_PathAsRect == path.asRect(&direction));
1629 REPORTER_ASSERT(reporter, SkPath::kStroke_PathAsRect == path.asRect());
1630 REPORTER_ASSERT(reporter, SkPath::kStroke_PathAsRect == path.asRect(&direction));
1632 REPORTER_ASSERT(reporter, direction == cheapDirection);
1636 REPORTER_ASSERT(reporter, !path.isRect(&computed));
1637 REPORTER_ASSERT(reporter, computed.fLeft == 123 && computed.fTop == 456);
1638 REPORTER_ASSERT(reporter, computed.fRight == 789 && computed.fBottom == 1011);
1642 REPORTER_ASSERT(reporter, !path.isRect(&isClosed, &direction));
1643 REPORTER_ASSERT(reporter, isClosed == (bool) -1);
1644 REPORTER_ASSERT(reporter, direction == (SkPath::Direction) -1);
1645 REPORTER_ASSERT(reporter, SkPath::kNone_PathAsRect == path.asRect());
1646 REPORTER_ASSERT(reporter, SkPath::kNone_PathAsRect == path.asRect(&direction));
1647 REPORTER_ASSERT(reporter, direction == (SkPath::Direction) -1);
1659 REPORTER_ASSERT(reporter, !path1.isRect(NULL));
1671 REPORTER_ASSERT(reporter, !path1.isRect(NULL));
1680 REPORTER_ASSERT(reporter, !path1.isRect(NULL));
1692 REPORTER_ASSERT(reporter, !path1.isRect(NULL));
1704 REPORTER_ASSERT(reporter, !path1.isRect(NULL));
1707 static void test_isNestedRects(skiatest::Reporter* reporter) {
1791 REPORTER_ASSERT(reporter, tests[testIndex].fIsNestedRect == path.isNestedRects(NULL));
1805 REPORTER_ASSERT(reporter, path.isNestedRects(computed, computedDirs));
1806 REPORTER_ASSERT(reporter, expected[0] == computed[0]);
1807 REPORTER_ASSERT(reporter, expected[1] == computed[1]);
1808 REPORTER_ASSERT(reporter, expectedDirs[0] == computedDirs[0]);
1809 REPORTER_ASSERT(reporter, expectedDirs[1] == computedDirs[1]);
1827 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1845 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1860 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1878 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1896 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1902 REPORTER_ASSERT(reporter, !path1.isNestedRects(NULL));
1912 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL));
1915 static void write_and_read_back(skiatest::Reporter* reporter,
1925 REPORTER_ASSERT(reporter, readBack != p);
1927 REPORTER_ASSERT(reporter, readBack == p);
1929 REPORTER_ASSERT(reporter, readBack.getConvexityOrUnknown() ==
1932 REPORTER_ASSERT(reporter, readBack.isOval(NULL) == p.isOval(NULL));
1937 REPORTER_ASSERT(reporter, origBounds == readBackBounds);
1940 static void test_flattening(skiatest::Reporter* reporter) {
1954 write_and_read_back(reporter, p);
1961 REPORTER_ASSERT(reporter, size1 == size2);
1965 REPORTER_ASSERT(reporter, size1 == size3);
1966 REPORTER_ASSERT(reporter, p == p2);
1969 REPORTER_ASSERT(reporter, !size3);
1973 REPORTER_ASSERT(reporter, tooShort.isEmpty());
1977 REPORTER_ASSERT(reporter, size1 == size3);
1978 REPORTER_ASSERT(reporter, memcmp(buffer, buffer2, size1) == 0);
1986 write_and_read_back(reporter, oval);
1990 static void test_transform(skiatest::Reporter* reporter) {
2019 REPORTER_ASSERT(reporter, p == p1);
2032 REPORTER_ASSERT(reporter, kPtCount == count);
2035 REPORTER_ASSERT(reporter, newPt == pts1[i]);
2048 REPORTER_ASSERT(reporter, matrix.invert(&matrix));
2052 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(pBounds.fLeft, p1Bounds.fLeft));
2053 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(pBounds.fTop, p1Bounds.fTop));
2054 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(pBounds.fRight, p1Bounds.fRight));
2055 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(pBounds.fBottom, p1Bounds.fBottom));
2068 REPORTER_ASSERT(reporter, p1.cheapIsDirection(SkPath::kCW_Direction));
2080 REPORTER_ASSERT(reporter, p1.cheapIsDirection(SkPath::kCCW_Direction));
2090 REPORTER_ASSERT(reporter, p1.cheapIsDirection(SkPath::kUnknown_Direction));
2094 static void test_zero_length_paths(skiatest::Reporter* reporter) {
2154 REPORTER_ASSERT(reporter, valid);
2155 REPORTER_ASSERT(reporter, !p.isEmpty());
2156 REPORTER_ASSERT(reporter, gZeroLengthTests[i].numResultPts == (size_t)p.countPoints());
2157 REPORTER_ASSERT(reporter, gZeroLengthTests[i].resultBound == p.getBounds());
2158 REPORTER_ASSERT(reporter, gZeroLengthTests[i].numResultVerbs == (size_t)p.getVerbs(verbs, SK_ARRAY_COUNT(verbs)));
2160 REPORTER_ASSERT(reporter, gZeroLengthTests[i].resultVerbs[j] == verbs[j]);
2172 static void test_segment_masks(skiatest::Reporter* reporter) {
2177 REPORTER_ASSERT(reporter, SkPath::kQuad_SegmentMask == p.getSegmentMasks());
2178 REPORTER_ASSERT(reporter, !p.isEmpty());
2180 REPORTER_ASSERT(reporter, p2.getSegmentMasks() == p.getSegmentMasks());
2182 REPORTER_ASSERT(reporter, kCurveSegmentMask == p.getSegmentMasks());
2183 REPORTER_ASSERT(reporter, !p.isEmpty());
2185 REPORTER_ASSERT(reporter, p2.getSegmentMasks() == p.getSegmentMasks());
2190 REPORTER_ASSERT(reporter, SkPath::kCubic_SegmentMask == p.getSegmentMasks());
2192 REPORTER_ASSERT(reporter, p2.getSegmentMasks() == p.getSegmentMasks());
2194 REPORTER_ASSERT(reporter, !p.isEmpty());
2197 static void test_iter(skiatest::Reporter* reporter) {
2203 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb);
2207 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb);
2211 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb);
2215 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2219 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2283 REPORTER_ASSERT(reporter, valid);
2287 REPORTER_ASSERT(reporter, iter.next(pts, gIterTests[i].consumeDegenerates) == gIterTests[i].resultVerbs[j]);
2289 REPORTER_ASSERT(reporter, pts[k] == gIterTests[i].resultPts[l++]);
2292 REPORTER_ASSERT(reporter, j == (int)gIterTests[i].numResultVerbs);
2297 REPORTER_ASSERT(reporter, !iter.isClosedContour());
2301 REPORTER_ASSERT(reporter, iter.isClosedContour());
2304 REPORTER_ASSERT(reporter, !iter.isClosedContour());
2307 REPORTER_ASSERT(reporter, iter.isClosedContour());
2311 REPORTER_ASSERT(reporter, !iter.isClosedContour());
2322 REPORTER_ASSERT(reporter, SkPath::kClose_Verb == iter.next(pts, false));
2329 REPORTER_ASSERT(reporter, SkPath::kQuad_Verb == iter.next(pts, false));
2332 REPORTER_ASSERT(reporter, SkPath::kDone_Verb == iter.next(pts, true));
2338 REPORTER_ASSERT(reporter, SkPath::kConic_Verb == iter.next(pts, false));
2341 REPORTER_ASSERT(reporter, SkPath::kDone_Verb == iter.next(pts, true));
2347 REPORTER_ASSERT(reporter, SkPath::kCubic_Verb == iter.next(pts, false));
2350 REPORTER_ASSERT(reporter, SkPath::kDone_Verb == iter.next(pts, true));
2355 REPORTER_ASSERT(reporter, SkPath::kCubic_Verb == iter.next(pts, false));
2358 REPORTER_ASSERT(reporter, SkPath::kDone_Verb == iter.next(pts, true));
2363 static void test_raw_iter(skiatest::Reporter* reporter) {
2369 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb);
2372 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb);
2376 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2381 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2382 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1);
2383 REPORTER_ASSERT(reporter, pts[0].fY == 0);
2384 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2390 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2391 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1);
2392 REPORTER_ASSERT(reporter, pts[0].fY == 0);
2393 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2394 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2);
2395 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1);
2396 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2397 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*3);
2398 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*2);
2399 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2405 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2419 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2420 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1);
2421 REPORTER_ASSERT(reporter, pts[0].fY == 0);
2422 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb);
2423 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1);
2424 REPORTER_ASSERT(reporter, pts[0].fY == 0);
2425 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2426 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2);
2427 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1);
2428 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb);
2429 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2);
2430 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1);
2431 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2432 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*3);
2433 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*2);
2434 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb);
2435 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*4);
2436 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*3);
2437 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb);
2438 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*4);
2439 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*3);
2440 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb);
2547 REPORTER_ASSERT(reporter, nextVerb == expectedVerbs[numIterVerbs]);
2551 REPORTER_ASSERT(reporter, numIterPts < numPoints);
2552 REPORTER_ASSERT(reporter, pts[0] == expectedPts[numIterPts]);
2557 REPORTER_ASSERT(reporter, numIterPts < numPoints + 1);
2558 REPORTER_ASSERT(reporter, pts[0] == lastPt);
2559 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]);
2565 REPORTER_ASSERT(reporter, numIterPts < numPoints + 2);
2566 REPORTER_ASSERT(reporter, pts[0] == lastPt);
2567 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]);
2568 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]);
2573 REPORTER_ASSERT(reporter, numIterPts < numPoints + 3);
2574 REPORTER_ASSERT(reporter, pts[0] == lastPt);
2575 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]);
2576 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]);
2577 REPORTER_ASSERT(reporter, pts[3] == expectedPts[numIterPts + 2]);
2582 REPORTER_ASSERT(reporter, pts[0] == lastMoveTo);
2589 REPORTER_ASSERT(reporter, numIterPts == numPoints);
2590 REPORTER_ASSERT(reporter, numIterVerbs == numVerbs);
2594 static void check_for_circle(skiatest::Reporter* reporter,
2599 REPORTER_ASSERT(reporter, path.isOval(&rect) == expectedCircle);
2600 REPORTER_ASSERT(reporter, path.cheapIsDirection(expectedDir));
2603 REPORTER_ASSERT(reporter, rect.height() == rect.width());
2607 static void test_circle_skew(skiatest::Reporter* reporter,
2619 REPORTER_ASSERT(reporter, SkPath::kCW_Direction == dir);
2622 check_for_circle(reporter, tmp, false, dir);
2625 static void test_circle_translate(skiatest::Reporter* reporter,
2634 check_for_circle(reporter, tmp, true, dir);
2642 check_for_circle(reporter, tmp, true, dir);
2645 static void test_circle_rotate(skiatest::Reporter* reporter,
2658 check_for_circle(reporter, tmp, true, dir);
2660 check_for_circle(reporter, tmp, false, dir);
2665 static void test_circle_mirror_x(skiatest::Reporter* reporter,
2677 REPORTER_ASSERT(reporter, SkPath::kCCW_Direction == dir);
2681 check_for_circle(reporter, tmp, true, dir);
2684 static void test_circle_mirror_y(skiatest::Reporter* reporter,
2696 REPORTER_ASSERT(reporter, SkPath::kCCW_Direction == dir);
2700 check_for_circle(reporter, tmp, true, dir);
2703 static void test_circle_mirror_xy(skiatest::Reporter* reporter,
2713 check_for_circle(reporter, tmp, true, dir);
2716 static void test_circle_with_direction(skiatest::Reporter* reporter,
2722 check_for_circle(reporter, path, true, dir);
2723 test_circle_rotate(reporter, path, dir);
2724 test_circle_translate(reporter, path, dir);
2725 test_circle_skew(reporter, path, dir);
2731 check_for_circle(reporter, path, true, dir);
2732 test_circle_rotate(reporter, path, dir);
2733 test_circle_translate(reporter, path, dir);
2734 test_circle_skew(reporter, path, dir);
2735 test_circle_mirror_x(reporter, path, dir);
2736 test_circle_mirror_y(reporter, path, dir);
2737 test_circle_mirror_xy(reporter, path, dir);
2740 static void test_circle_with_add_paths(skiatest::Reporter* reporter) {
2762 check_for_circle(reporter, path, false, kCircleDir);
2767 check_for_circle(reporter, path, true, kCircleDir);
2772 check_for_circle(reporter, path, false, kCircleDirOpposite);
2775 static void test_circle(skiatest::Reporter* reporter) {
2776 test_circle_with_direction(reporter, SkPath::kCW_Direction);
2777 test_circle_with_direction(reporter, SkPath::kCCW_Direction);
2783 check_for_circle(reporter, path, false, SkPath::kCW_Direction);
2789 check_for_circle(reporter, path, false, SkPath::kCW_Direction);
2795 check_for_circle(reporter, path, false, SkPath::kCW_Direction);
2797 test_circle_with_add_paths(reporter);
2802 REPORTER_ASSERT(reporter, path.isEmpty());
2805 static void test_oval(skiatest::Reporter* reporter) {
2813 REPORTER_ASSERT(reporter, path.isOval(NULL));
2819 REPORTER_ASSERT(reporter, tmp.isOval(NULL));
2826 REPORTER_ASSERT(reporter, !tmp.isOval(NULL));
2833 REPORTER_ASSERT(reporter, !tmp.isOval(NULL));
2837 REPORTER_ASSERT(reporter, !tmp.isOval(NULL));
2843 REPORTER_ASSERT(reporter, !tmp.isOval(NULL));
2850 REPORTER_ASSERT(reporter, path.isOval(NULL));
2857 REPORTER_ASSERT(reporter, path.isOval(NULL));
2860 static void test_empty(skiatest::Reporter* reporter, const SkPath& p) {
2863 REPORTER_ASSERT(reporter, p.isEmpty());
2864 REPORTER_ASSERT(reporter, 0 == p.countPoints());
2865 REPORTER_ASSERT(reporter, 0 == p.countVerbs());
2866 REPORTER_ASSERT(reporter, 0 == p.getSegmentMasks());
2867 REPORTER_ASSERT(reporter, p.isConvex());
2868 REPORTER_ASSERT(reporter, p.getFillType() == SkPath::kWinding_FillType);
2869 REPORTER_ASSERT(reporter, !p.isInverseFillType());
2870 REPORTER_ASSERT(reporter, p == empty);
2871 REPORTER_ASSERT(reporter, !(p != empty));
2874 static void test_rrect_is_convex(skiatest::Reporter* reporter, SkPath* path,
2876 REPORTER_ASSERT(reporter, path->isConvex());
2877 REPORTER_ASSERT(reporter, path->cheapIsDirection(dir));
2879 REPORTER_ASSERT(reporter, path->isConvex());
2883 static void test_rrect(skiatest::Reporter* reporter) {
2890 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2892 test_rrect_is_convex(reporter, &p, SkPath::kCCW_Direction);
2894 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2896 test_rrect_is_convex(reporter, &p, SkPath::kCCW_Direction);
2898 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2900 test_rrect_is_convex(reporter, &p, SkPath::kCCW_Direction);
2906 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2911 REPORTER_ASSERT(reporter, p.isRect(&returnedRect));
2912 REPORTER_ASSERT(reporter, returnedRect == r);
2913 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2919 REPORTER_ASSERT(reporter, p.isRect(&closed, &dir));
2920 REPORTER_ASSERT(reporter, closed);
2921 REPORTER_ASSERT(reporter, SkPath::kCW_Direction == dir);
2922 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2925 REPORTER_ASSERT(reporter, !p.isConvex());
2929 REPORTER_ASSERT(reporter, !p.isConvex());
2934 REPORTER_ASSERT(reporter, p.isEmpty());
2938 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2942 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2945 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
2948 static void test_arc(skiatest::Reporter* reporter) {
2951 REPORTER_ASSERT(reporter, emptyOval.isEmpty());
2953 REPORTER_ASSERT(reporter, p.isEmpty());
2957 REPORTER_ASSERT(reporter, p.isEmpty());
2962 REPORTER_ASSERT(reporter, p == cwOval);
2967 REPORTER_ASSERT(reporter, p == ccwOval);
2970 REPORTER_ASSERT(reporter, p.isConvex());
2971 REPORTER_ASSERT(reporter, p.cheapIsDirection(SkPath::kCW_Direction));
2973 REPORTER_ASSERT(reporter, p.isConvex());
2976 static void check_move(skiatest::Reporter* reporter, SkPath::RawIter* iter,
2980 REPORTER_ASSERT(reporter, v == SkPath::kMove_Verb);
2981 REPORTER_ASSERT(reporter, pts[0].fX == x0);
2982 REPORTER_ASSERT(reporter, pts[0].fY == y0);
2985 static void check_line(skiatest::Reporter* reporter, SkPath::RawIter* iter,
2989 REPORTER_ASSERT(reporter, v == SkPath::kLine_Verb);
2990 REPORTER_ASSERT(reporter, pts[1].fX == x1);
2991 REPORTER_ASSERT(reporter, pts[1].fY == y1);
2994 static void check_quad(skiatest::Reporter* reporter, SkPath::RawIter* iter,
2998 REPORTER_ASSERT(reporter, v == SkPath::kQuad_Verb);
2999 REPORTER_ASSERT(reporter, pts[1].fX == x1);
3000 REPORTER_ASSERT(reporter, pts[1].fY == y1);
3001 REPORTER_ASSERT(reporter, pts[2].fX == x2);
3002 REPORTER_ASSERT(reporter, pts[2].fY == y2);
3005 static void check_done(skiatest::Reporter* reporter, SkPath* p, SkPath::RawIter* iter) {
3008 REPORTER_ASSERT(reporter, v == SkPath::kDone_Verb);
3011 static void check_done_and_reset(skiatest::Reporter* reporter, SkPath* p, SkPath::RawIter* iter) {
3012 check_done(reporter, p, iter);
3016 static void check_path_is_move_and_reset(skiatest::Reporter* reporter, SkPath* p,
3019 check_move(reporter, &iter, x0, y0);
3020 check_done_and_reset(reporter, p, &iter);
3023 static void check_path_is_line_and_reset(skiatest::Reporter* reporter, SkPath* p,
3026 check_move(reporter, &iter, 0, 0);
3027 check_line(reporter, &iter, x1, y1);
3028 check_done_and_reset(reporter, p, &iter);
3031 static void check_path_is_line(skiatest::Reporter* reporter, SkPath* p,
3034 check_move(reporter, &iter, 0, 0);
3035 check_line(reporter, &iter, x1, y1);
3036 check_done(reporter, p, &iter);
3039 static void check_path_is_line_pair_and_reset(skiatest::Reporter* reporter, SkPath* p,
3042 check_move(reporter, &iter, 0, 0);
3043 check_line(reporter, &iter, x1, y1);
3044 check_line(reporter, &iter, x2, y2);
3045 check_done_and_reset(reporter, p, &iter);
3048 static void check_path_is_quad_and_reset(skiatest::Reporter* reporter, SkPath* p,
3051 check_move(reporter, &iter, 0, 0);
3052 check_quad(reporter, &iter, x1, y1, x2, y2);
3053 check_done_and_reset(reporter, p, &iter);
3056 static void test_arcTo(skiatest::Reporter* reporter) {
3059 check_path_is_line_and_reset(reporter, &p, 0, 0);
3061 check_path_is_line_and_reset(reporter, &p, 1, 2);
3063 check_path_is_line_and_reset(reporter, &p, 1, 2);
3065 check_path_is_line_and_reset(reporter, &p, 1, 2);
3068 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt.fX == 1 && pt.fY == 1);
3071 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt.fX == 1 && pt.fY == -1);
3075 check_path_is_move_and_reset(reporter, &p, oval.fRight, oval.centerY());
3077 check_path_is_move_and_reset(reporter, &p, oval.fRight, oval.centerY());
3079 check_path_is_move_and_reset(reporter, &p, oval.fRight, oval.centerY());
3081 check_path_is_move_and_reset(reporter, &p, oval.fRight, oval.centerY());
3084 REPORTER_ASSERT(reporter, p.getBounds() == oval);
3090 REPORTER_ASSERT(reporter, p.getBounds() == oval);
3097 REPORTER_ASSERT(reporter, p.isEmpty());
3102 REPORTER_ASSERT(reporter, p.isEmpty());
3105 static void test_addPath(skiatest::Reporter* reporter) {
3116 REPORTER_ASSERT(reporter, p.getBounds() == expected);
3120 REPORTER_ASSERT(reporter, p.getBounds() == reverseExpected);
3123 static void test_addPathMode(skiatest::Reporter* reporter, bool explicitMoveTo, bool extend) {
3136 REPORTER_ASSERT(reporter, verbcount == 4);
3137 REPORTER_ASSERT(reporter, verbs[0] == SkPath::kMove_Verb);
3138 REPORTER_ASSERT(reporter, verbs[1] == SkPath::kLine_Verb);
3139 REPORTER_ASSERT(reporter, verbs[2] == (extend ? SkPath::kLine_Verb : SkPath::kMove_Verb));
3140 REPORTER_ASSERT(reporter, verbs[3] == SkPath::kLine_Verb);
3143 static void test_extendClosedPath(skiatest::Reporter* reporter) {
3154 REPORTER_ASSERT(reporter, verbcount == 7);
3155 REPORTER_ASSERT(reporter, verbs[0] == SkPath::kMove_Verb);
3156 REPORTER_ASSERT(reporter, verbs[1] == SkPath::kLine_Verb);
3157 REPORTER_ASSERT(reporter, verbs[2] == SkPath::kLine_Verb);
3158 REPORTER_ASSERT(reporter, verbs[3] == SkPath::kClose_Verb);
3159 REPORTER_ASSERT(reporter, verbs[4] == SkPath::kMove_Verb);
3160 REPORTER_ASSERT(reporter, verbs[5] == SkPath::kLine_Verb);
3161 REPORTER_ASSERT(reporter, verbs[6] == SkPath::kLine_Verb);
3164 REPORTER_ASSERT(reporter, p.getLastPt(&pt));
3165 REPORTER_ASSERT(reporter, pt == SkPoint::Make(2, 3));
3166 REPORTER_ASSERT(reporter, p.getPoint(3) == SkPoint::Make(1, 1));
3169 static void test_addEmptyPath(skiatest::Reporter* reporter, SkPath::AddPathMode mode) {
3175 REPORTER_ASSERT(reporter, q == p);
3178 REPORTER_ASSERT(reporter, q == p);
3182 REPORTER_ASSERT(reporter, q.isEmpty());
3185 static void test_conicTo_special_case(skiatest::Reporter* reporter) {
3188 check_path_is_line_and_reset(reporter, &p, 3, 4);
3190 check_path_is_line_pair_and_reset(reporter, &p, 1, 2, 3, 4);
3192 check_path_is_quad_and_reset(reporter, &p, 1, 2, 3, 4);
3195 static void test_get_point(skiatest::Reporter* reporter) {
3198 REPORTER_ASSERT(reporter, pt == SkPoint::Make(0, 0));
3199 REPORTER_ASSERT(reporter, !p.getLastPt(NULL));
3200 REPORTER_ASSERT(reporter, !p.getLastPt(&pt) && pt == SkPoint::Make(0, 0));
3203 REPORTER_ASSERT(reporter, pt == SkPoint::Make(10, 10));
3204 REPORTER_ASSERT(reporter, p.getLastPt(NULL));
3206 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt == SkPoint::Make(20, 20));
3209 static void test_contains(skiatest::Reporter* reporter) {
3212 REPORTER_ASSERT(reporter, p.contains(0, 0));
3214 REPORTER_ASSERT(reporter, !p.contains(0, 0));
3219 REPORTER_ASSERT(reporter, !p.contains(4, 0));
3220 REPORTER_ASSERT(reporter, !p.contains(0, 4));
3221 REPORTER_ASSERT(reporter, !p.contains(4, 10));
3222 REPORTER_ASSERT(reporter, !p.contains(10, 4));
3224 REPORTER_ASSERT(reporter, !p.contains(5, 7));
3225 REPORTER_ASSERT(reporter, p.contains(6, 7));
3226 REPORTER_ASSERT(reporter, !p.contains(7, 7));
3232 REPORTER_ASSERT(reporter, !p.contains(7, 5));
3233 REPORTER_ASSERT(reporter, p.contains(7, 6));
3234 REPORTER_ASSERT(reporter, !p.contains(7, 7));
3241 REPORTER_ASSERT(reporter, p.contains(5, 6));
3242 REPORTER_ASSERT(reporter, !p.contains(6, 5));
3249 REPORTER_ASSERT(reporter, p.contains(5, 6));
3250 REPORTER_ASSERT(reporter, !p.contains(6, 5));
3259 REPORTER_ASSERT(reporter, p.contains(5, 6));
3260 REPORTER_ASSERT(reporter, !p.contains(6, 5));
3272 REPORTER_ASSERT(reporter, p.contains(5.5f, 5.5f));
3273 REPORTER_ASSERT(reporter, !p.contains(4.5f, 5.5f));
3279 static void TestPathRef(skiatest::Reporter* reporter) {
3288 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countVerbs());
3289 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countPoints());
3290 REPORTER_ASSERT(reporter, 0 == pathRef->getSegmentMasks());
3292 REPORTER_ASSERT(reporter, SkPath::kMove_Verb == pathRef->atVerb(i));
3299 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countVerbs());
3300 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countPoints());
3301 REPORTER_ASSERT(reporter, SkPath::kLine_SegmentMask == pathRef->getSegmentMasks());
3303 REPORTER_ASSERT(reporter, SkPath::kLine_Verb == pathRef->atVerb(i));
3310 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countVerbs());
3311 REPORTER_ASSERT(reporter, 2*kRepeatCnt == pathRef->countPoints());
3312 REPORTER_ASSERT(reporter, SkPath::kQuad_SegmentMask == pathRef->getSegmentMasks());
3314 REPORTER_ASSERT(reporter, SkPath::kQuad_Verb == pathRef->atVerb(i));
3322 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countVerbs());
3323 REPORTER_ASSERT(reporter, 2*kRepeatCnt == pathRef->countPoints());
3324 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countWeights());
3325 REPORTER_ASSERT(reporter, SkPath::kConic_SegmentMask == pathRef->getSegmentMasks());
3326 REPORTER_ASSERT(reporter, NULL != weights);
3328 REPORTER_ASSERT(reporter, SkPath::kConic_Verb == pathRef->atVerb(i));
3335 REPORTER_ASSERT(reporter, kRepeatCnt == pathRef->countVerbs());
3336 REPORTER_ASSERT(reporter, 3*kRepeatCnt == pathRef->countPoints());
3337 REPORTER_ASSERT(reporter, SkPath::kCubic_SegmentMask == pathRef->getSegmentMasks());
3339 REPORTER_ASSERT(reporter, SkPath::kCubic_Verb == pathRef->atVerb(i));
3346 static void test_operatorEqual(skiatest::Reporter* reporter) {
3349 REPORTER_ASSERT(reporter, a == a);
3350 REPORTER_ASSERT(reporter, a == b);
3352 REPORTER_ASSERT(reporter, a != b);
3354 REPORTER_ASSERT(reporter, a == b);
3356 REPORTER_ASSERT(reporter, a != b);
3358 REPORTER_ASSERT(reporter, a == b);
3361 REPORTER_ASSERT(reporter, a != b);
3364 REPORTER_ASSERT(reporter, a == b);
3369 static void TestPathTo(skiatest::Reporter* reporter) {
3373 reporter, &p, 4, 4);
3376 check_path_is_line(reporter, &p, 4, 4);
3384 REPORTER_ASSERT(reporter, p.getBounds() == reverseExpected);
3388 DEF_TEST(Paths, reporter) {
3395 test_empty(reporter, p);
3397 REPORTER_ASSERT(reporter, p.getBounds().isEmpty());
3409 check_convex_bounds(reporter, p, bounds);
3411 REPORTER_ASSERT(reporter, p.getSegmentMasks() & kCurveSegmentMask);
3412 REPORTER_ASSERT(reporter, !p.isEmpty());
3415 test_empty(reporter, p);
3418 check_convex_bounds(reporter, p, bounds);
3419 REPORTER_ASSERT(reporter, !p.isEmpty());
3422 test_empty(reporter, p);
3425 check_convex_bounds(reporter, p, bounds);
3427 REPORTER_ASSERT(reporter, SkPath::kLine_SegmentMask == p.getSegmentMasks());
3428 REPORTER_ASSERT(reporter, !p.isEmpty());
3430 REPORTER_ASSERT(reporter, p != empty);
3431 REPORTER_ASSERT(reporter, !(p == empty));
3434 REPORTER_ASSERT(reporter, p.getPoints(NULL, 0) == 4);
3435 REPORTER_ASSERT(reporter, p.getVerbs(NULL, 0) == 5);
3438 REPORTER_ASSERT(reporter, count == 4);
3442 REPORTER_ASSERT(reporter, SkPath::kMove_Verb == verbs[0]);
3443 REPORTER_ASSERT(reporter, SkPath::kLine_Verb == verbs[1]);
3444 REPORTER_ASSERT(reporter, SkPath::kLine_Verb == verbs[2]);
3445 REPORTER_ASSERT(reporter, SkPath::kLine_Verb == verbs[3]);
3446 REPORTER_ASSERT(reporter, SkPath::kClose_Verb == verbs[4]);
3447 REPORTER_ASSERT(reporter, 0xff == verbs[5]);
3449 REPORTER_ASSERT(reporter, bounds == bounds2);
3453 REPORTER_ASSERT(reporter, bounds == p.getBounds());
3455 REPORTER_ASSERT(reporter, p.isRect(NULL));
3457 REPORTER_ASSERT(reporter, p.isRect(&bounds2));
3458 REPORTER_ASSERT(reporter, bounds == bounds2);
3463 REPORTER_ASSERT(reporter, !p.isRect(NULL));
3465 test_operatorEqual(reporter);
3466 test_isLine(reporter);
3467 test_isRect(reporter);
3468 test_isNestedRects(reporter);
3469 test_zero_length_paths(reporter);
3470 test_direction(reporter);
3471 test_convexity(reporter);
3472 test_convexity2(reporter);
3473 test_conservativelyContains(reporter);
3474 test_close(reporter);
3475 test_segment_masks(reporter);
3476 test_flattening(reporter);
3477 test_transform(reporter);
3478 test_bounds(reporter);
3479 test_iter(reporter);
3480 test_raw_iter(reporter);
3481 test_circle(reporter);
3482 test_oval(reporter);
3483 test_strokerec(reporter);
3484 test_addPoly(reporter);
3485 test_isfinite(reporter);
3486 test_isfinite_after_transform(reporter);
3487 test_arb_round_rect_is_convex(reporter);
3488 test_arb_zero_rad_round_rect_is_rect(reporter);
3489 test_addrect(reporter);
3490 test_addrect_isfinite(reporter);
3496 test_android_specific_behavior(reporter);
3497 test_gen_id(reporter);
3498 test_path_close_issue1474(reporter);
3499 test_path_to_region(reporter);
3500 test_rrect(reporter);
3501 test_arc(reporter);
3502 test_arcTo(reporter);
3503 test_addPath(reporter);
3504 test_addPathMode(reporter, false, false);
3505 test_addPathMode(reporter, true, false);
3506 test_addPathMode(reporter, false, true);
3507 test_addPathMode(reporter, true, true);
3508 test_extendClosedPath(reporter);
3509 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode);
3510 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode);
3511 test_conicTo_special_case(reporter);
3512 test_get_point(reporter);
3513 test_contains(reporter);
3514 PathTest_Private::TestPathTo(reporter);
3515 PathRefTest_Private::TestPathRef(reporter);