Lines Matching refs:reporter
25 skiatest::Reporter* reporter) { in check_direction() argument
27 REPORTER_ASSERT(reporter, path->cheapIsDirection(expectedDir)); in check_direction()
30 REPORTER_ASSERT(reporter, path->cheapIsDirection(expectedDir)); in check_direction()
33 static void test_direction(skiatest::Reporter* reporter) { in test_direction() argument
36 REPORTER_ASSERT(reporter, !path.cheapComputeDirection(NULL)); in test_direction()
37 REPORTER_ASSERT(reporter, !path.cheapIsDirection(SkPath::kCW_Direction)); in test_direction()
38 REPORTER_ASSERT(reporter, !path.cheapIsDirection(SkPath::kCCW_Direction)); in test_direction()
51 REPORTER_ASSERT(reporter, valid); in test_direction()
52 REPORTER_ASSERT(reporter, !path.cheapComputeDirection(NULL)); in test_direction()
63 REPORTER_ASSERT(reporter, valid); in test_direction()
64 check_direction(&path, SkPath::kCW_Direction, reporter); in test_direction()
75 REPORTER_ASSERT(reporter, valid); in test_direction()
76 check_direction(&path, SkPath::kCCW_Direction, reporter); in test_direction()
84 check_direction(&path, SkPath::kCW_Direction, reporter); in test_direction()
89 check_direction(&path, SkPath::kCCW_Direction, reporter); in test_direction()
98 check_direction(&path, SkPath::kCCW_Direction, reporter); in test_direction()
110 static void test_bounds(skiatest::Reporter* reporter) { in test_bounds() argument
124 REPORTER_ASSERT(reporter, path0.getBounds() == path1.getBounds()); in test_bounds()
163 static void check_close(skiatest::Reporter* reporter, const SkPath& path) { in check_close() argument
179 REPORTER_ASSERT(reporter, mv == pts[0]); in check_close()
188 REPORTER_ASSERT(reporter, !i || nMT == nCL); in check_close()
192 static void test_close(skiatest::Reporter* reporter) { in test_close() argument
196 check_close(reporter, closePt); in test_close()
200 check_close(reporter, openPt); in test_close()
203 check_close(reporter, empty); in test_close()
205 check_close(reporter, empty); in test_close()
209 check_close(reporter, rect); in test_close()
211 check_close(reporter, rect); in test_close()
215 check_close(reporter, quad); in test_close()
217 check_close(reporter, quad); in test_close()
222 check_close(reporter, cubic); in test_close()
224 check_close(reporter, cubic); in test_close()
229 check_close(reporter, line); in test_close()
231 check_close(reporter, line); in test_close()
237 check_close(reporter, rect2); in test_close()
239 check_close(reporter, rect2); in test_close()
245 check_close(reporter, oval3); in test_close()
247 check_close(reporter, oval3); in test_close()
254 check_close(reporter, moves); in test_close()
259 static void check_convexity(skiatest::Reporter* reporter, const SkPath& path, in check_convexity() argument
262 REPORTER_ASSERT(reporter, c == expected); in check_convexity()
265 static void test_convexity2(skiatest::Reporter* reporter) { in test_convexity2() argument
269 check_convexity(reporter, pt, SkPath::kConvex_Convexity); in test_convexity2()
275 check_convexity(reporter, pt, SkPath::kConvex_Convexity); in test_convexity2()
282 check_convexity(reporter, triLeft, SkPath::kConvex_Convexity); in test_convexity2()
289 check_convexity(reporter, triRight, SkPath::kConvex_Convexity); in test_convexity2()
297 check_convexity(reporter, square, SkPath::kConvex_Convexity); in test_convexity2()
313 check_convexity(reporter, redundantSquare, SkPath::kConvex_Convexity); in test_convexity2()
329 check_convexity(reporter, bowTie, SkPath::kConcave_Convexity); in test_convexity2()
340 check_convexity(reporter, spiral, SkPath::kConcave_Convexity); in test_convexity2()
349 check_convexity(reporter, dent, SkPath::kConcave_Convexity); in test_convexity2()
352 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p, in check_convex_bounds() argument
354 REPORTER_ASSERT(reporter, p.isConvex()); in check_convex_bounds()
355 REPORTER_ASSERT(reporter, p.getBounds() == bounds); in check_convex_bounds()
358 REPORTER_ASSERT(reporter, p2.isConvex()); in check_convex_bounds()
359 REPORTER_ASSERT(reporter, p2.getBounds() == bounds); in check_convex_bounds()
363 REPORTER_ASSERT(reporter, other.isConvex()); in check_convex_bounds()
364 REPORTER_ASSERT(reporter, other.getBounds() == bounds); in check_convex_bounds()
386 static void test_convexity(skiatest::Reporter* reporter) { in test_convexity() argument
392 REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); in test_convexity()
394 REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); in test_convexity()
396 REPORTER_ASSERT(reporter, C == SkPath::ComputeConvexity(path)); in test_convexity()
399 REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); in test_convexity()
400 REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCCW_Direction)); in test_convexity()
403 REPORTER_ASSERT(reporter, V == SkPath::ComputeConvexity(path)); in test_convexity()
404 REPORTER_ASSERT(reporter, path.cheapIsDirection(SkPath::kCW_Direction)); in test_convexity()
424 REPORTER_ASSERT(reporter, c == gRec[i].fExpectedConvexity); in test_convexity()
430 static void test_isRect(skiatest::Reporter* reporter) { in test_isRect() argument
491 REPORTER_ASSERT(reporter, fail ^ path.isRect(0)); in test_isRect()
508 REPORTER_ASSERT(reporter, fail ^ path1.isRect(0)); in test_isRect()
520 REPORTER_ASSERT(reporter, fail ^ path1.isRect(0)); in test_isRect()
529 REPORTER_ASSERT(reporter, fail ^ path1.isRect(0)); in test_isRect()
541 REPORTER_ASSERT(reporter, fail ^ path1.isRect(0)); in test_isRect()
553 REPORTER_ASSERT(reporter, fail ^ path1.isRect(0)); in test_isRect()
556 static void test_flattening(skiatest::Reporter* reporter) { in test_flattening() argument
578 REPORTER_ASSERT(reporter, p1 != p); in test_flattening()
580 REPORTER_ASSERT(reporter, p1 == p); in test_flattening()
583 static void test_transform(skiatest::Reporter* reporter) { in test_transform() argument
600 REPORTER_ASSERT(reporter, p == p1); in test_transform()
606 REPORTER_ASSERT(reporter, 7 == count); in test_transform()
609 REPORTER_ASSERT(reporter, newPt == pts1[i]); in test_transform()
613 static void test_zero_length_paths(skiatest::Reporter* reporter) { in test_zero_length_paths() argument
620 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
621 REPORTER_ASSERT(reporter, 1 == p.countPoints()); in test_zero_length_paths()
623 REPORTER_ASSERT(reporter, pt.fX == SK_Scalar1); in test_zero_length_paths()
624 REPORTER_ASSERT(reporter, pt.fY == SK_Scalar1); in test_zero_length_paths()
626 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
630 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
631 REPORTER_ASSERT(reporter, 2 == p.countPoints()); in test_zero_length_paths()
633 REPORTER_ASSERT(reporter, pt.fX == SK_Scalar1*2); in test_zero_length_paths()
634 REPORTER_ASSERT(reporter, pt.fY == SK_Scalar1); in test_zero_length_paths()
636 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
643 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
644 REPORTER_ASSERT(reporter, 1 == p.countPoints()); in test_zero_length_paths()
645 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
651 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
652 REPORTER_ASSERT(reporter, 2 == p.countPoints()); in test_zero_length_paths()
653 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
660 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
661 REPORTER_ASSERT(reporter, 2 == p.countPoints()); in test_zero_length_paths()
662 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
668 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
669 REPORTER_ASSERT(reporter, 4 == p.countPoints()); in test_zero_length_paths()
670 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
678 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
679 REPORTER_ASSERT(reporter, 2 == p.countPoints()); in test_zero_length_paths()
680 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
687 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
688 REPORTER_ASSERT(reporter, 4 == p.countPoints()); in test_zero_length_paths()
689 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
696 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
697 REPORTER_ASSERT(reporter, 3 == p.countPoints()); in test_zero_length_paths()
698 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
702 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
703 REPORTER_ASSERT(reporter, 3 == p.countPoints()); in test_zero_length_paths()
704 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
713 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
714 REPORTER_ASSERT(reporter, 6 == p.countPoints()); in test_zero_length_paths()
715 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
724 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
725 REPORTER_ASSERT(reporter, 4 == p.countPoints()); in test_zero_length_paths()
726 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
730 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
731 REPORTER_ASSERT(reporter, 4 == p.countPoints()); in test_zero_length_paths()
732 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
745 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_zero_length_paths()
746 REPORTER_ASSERT(reporter, 8 == p.countPoints()); in test_zero_length_paths()
747 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in test_zero_length_paths()
757 static void test_segment_masks(skiatest::Reporter* reporter) { in test_segment_masks() argument
761 REPORTER_ASSERT(reporter, SkPath::kQuad_SegmentMask == p.getSegmentMasks()); in test_segment_masks()
762 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_segment_masks()
764 REPORTER_ASSERT(reporter, kCurveSegmentMask == p.getSegmentMasks()); in test_segment_masks()
765 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_segment_masks()
769 REPORTER_ASSERT(reporter, SkPath::kCubic_SegmentMask == p.getSegmentMasks()); in test_segment_masks()
770 REPORTER_ASSERT(reporter, !p.isEmpty()); in test_segment_masks()
773 static void test_iter(skiatest::Reporter* reporter) { in test_iter() argument
779 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb); in test_iter()
782 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb); in test_iter()
785 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb); in test_iter()
789 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_iter()
793 REPORTER_ASSERT(reporter, forceCloseIter.next(pts) == SkPath::kDone_Verb); in test_iter()
798 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_iter()
806 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_iter()
810 REPORTER_ASSERT(reporter, forceCloseIter.next(pts) == SkPath::kDone_Verb); in test_iter()
816 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_iter()
819 REPORTER_ASSERT(reporter, forceCloseIter.next(pts) == SkPath::kDone_Verb); in test_iter()
833 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_iter()
836 REPORTER_ASSERT(reporter, forceCloseIter.next(pts) == SkPath::kDone_Verb); in test_iter()
841 static void test_raw_iter(skiatest::Reporter* reporter) { in test_raw_iter() argument
847 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
850 REPORTER_ASSERT(reporter, noPathIter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
854 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
859 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
860 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1); in test_raw_iter()
861 REPORTER_ASSERT(reporter, pts[0].fY == 0); in test_raw_iter()
862 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
868 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
869 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1); in test_raw_iter()
870 REPORTER_ASSERT(reporter, pts[0].fY == 0); in test_raw_iter()
871 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
872 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2); in test_raw_iter()
873 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1); in test_raw_iter()
874 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
875 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*3); in test_raw_iter()
876 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*2); in test_raw_iter()
877 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
883 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
897 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
898 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1); in test_raw_iter()
899 REPORTER_ASSERT(reporter, pts[0].fY == 0); in test_raw_iter()
900 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb); in test_raw_iter()
901 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1); in test_raw_iter()
902 REPORTER_ASSERT(reporter, pts[0].fY == 0); in test_raw_iter()
903 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
904 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2); in test_raw_iter()
905 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1); in test_raw_iter()
906 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb); in test_raw_iter()
907 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*2); in test_raw_iter()
908 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1); in test_raw_iter()
909 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
910 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*3); in test_raw_iter()
911 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*2); in test_raw_iter()
912 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kMove_Verb); in test_raw_iter()
913 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*4); in test_raw_iter()
914 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*3); in test_raw_iter()
915 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kClose_Verb); in test_raw_iter()
916 REPORTER_ASSERT(reporter, pts[0].fX == SK_Scalar1*4); in test_raw_iter()
917 REPORTER_ASSERT(reporter, pts[0].fY == SK_Scalar1*3); in test_raw_iter()
918 REPORTER_ASSERT(reporter, iter.next(pts) == SkPath::kDone_Verb); in test_raw_iter()
1012 REPORTER_ASSERT(reporter, nextVerb == expectedVerbs[numIterVerbs]); in test_raw_iter()
1016 REPORTER_ASSERT(reporter, numIterPts < numPoints); in test_raw_iter()
1017 REPORTER_ASSERT(reporter, pts[0] == expectedPts[numIterPts]); in test_raw_iter()
1022 REPORTER_ASSERT(reporter, numIterPts < numPoints + 1); in test_raw_iter()
1023 REPORTER_ASSERT(reporter, pts[0] == lastPt); in test_raw_iter()
1024 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]); in test_raw_iter()
1029 REPORTER_ASSERT(reporter, numIterPts < numPoints + 2); in test_raw_iter()
1030 REPORTER_ASSERT(reporter, pts[0] == lastPt); in test_raw_iter()
1031 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]); in test_raw_iter()
1032 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]); in test_raw_iter()
1037 REPORTER_ASSERT(reporter, numIterPts < numPoints + 3); in test_raw_iter()
1038 REPORTER_ASSERT(reporter, pts[0] == lastPt); in test_raw_iter()
1039 REPORTER_ASSERT(reporter, pts[1] == expectedPts[numIterPts]); in test_raw_iter()
1040 REPORTER_ASSERT(reporter, pts[2] == expectedPts[numIterPts + 1]); in test_raw_iter()
1041 REPORTER_ASSERT(reporter, pts[3] == expectedPts[numIterPts + 2]); in test_raw_iter()
1046 REPORTER_ASSERT(reporter, pts[0] == lastMoveTo); in test_raw_iter()
1052 REPORTER_ASSERT(reporter, numIterPts == numPoints); in test_raw_iter()
1053 REPORTER_ASSERT(reporter, numIterVerbs == numVerbs); in test_raw_iter()
1057 void TestPath(skiatest::Reporter* reporter);
1058 void TestPath(skiatest::Reporter* reporter) { in TestPath() argument
1072 REPORTER_ASSERT(reporter, p.isEmpty()); in TestPath()
1073 REPORTER_ASSERT(reporter, 0 == p.countPoints()); in TestPath()
1074 REPORTER_ASSERT(reporter, 0 == p.getSegmentMasks()); in TestPath()
1075 REPORTER_ASSERT(reporter, p.isConvex()); in TestPath()
1076 REPORTER_ASSERT(reporter, p.getFillType() == SkPath::kWinding_FillType); in TestPath()
1077 REPORTER_ASSERT(reporter, !p.isInverseFillType()); in TestPath()
1078 REPORTER_ASSERT(reporter, p == p2); in TestPath()
1079 REPORTER_ASSERT(reporter, !(p != p2)); in TestPath()
1081 REPORTER_ASSERT(reporter, p.getBounds().isEmpty()); in TestPath()
1086 check_convex_bounds(reporter, p, bounds); in TestPath()
1088 REPORTER_ASSERT(reporter, p.getSegmentMasks() & kCurveSegmentMask); in TestPath()
1089 REPORTER_ASSERT(reporter, !p.isEmpty()); in TestPath()
1092 REPORTER_ASSERT(reporter, 0 == p.getSegmentMasks()); in TestPath()
1093 REPORTER_ASSERT(reporter, p.isEmpty()); in TestPath()
1096 check_convex_bounds(reporter, p, bounds); in TestPath()
1097 REPORTER_ASSERT(reporter, !p.isEmpty()); in TestPath()
1101 check_convex_bounds(reporter, p, bounds); in TestPath()
1103 REPORTER_ASSERT(reporter, SkPath::kLine_SegmentMask == p.getSegmentMasks()); in TestPath()
1104 REPORTER_ASSERT(reporter, !p.isEmpty()); in TestPath()
1106 REPORTER_ASSERT(reporter, p != p2); in TestPath()
1107 REPORTER_ASSERT(reporter, !(p == p2)); in TestPath()
1110 REPORTER_ASSERT(reporter, p.getPoints(NULL, 5) == 4); in TestPath()
1113 REPORTER_ASSERT(reporter, count == 4); in TestPath()
1115 REPORTER_ASSERT(reporter, bounds == bounds2); in TestPath()
1119 REPORTER_ASSERT(reporter, bounds == p.getBounds()); in TestPath()
1121 REPORTER_ASSERT(reporter, p.isRect(NULL)); in TestPath()
1123 REPORTER_ASSERT(reporter, p.isRect(&bounds2)); in TestPath()
1124 REPORTER_ASSERT(reporter, bounds == bounds2); in TestPath()
1129 REPORTER_ASSERT(reporter, !p.isRect(NULL)); in TestPath()
1130 test_isRect(reporter); in TestPath()
1132 test_zero_length_paths(reporter); in TestPath()
1133 test_direction(reporter); in TestPath()
1134 test_convexity(reporter); in TestPath()
1135 test_convexity2(reporter); in TestPath()
1136 test_close(reporter); in TestPath()
1137 test_segment_masks(reporter); in TestPath()
1138 test_flattening(reporter); in TestPath()
1139 test_transform(reporter); in TestPath()
1140 test_bounds(reporter); in TestPath()
1141 test_iter(reporter); in TestPath()
1142 test_raw_iter(reporter); in TestPath()