Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

251     TestCase(const Geo& geo, const SkPaint& paint, skiatest::Reporter* r,
257 TestCase(skiatest::Reporter* r, ShapeArgs... shapeArgs)
262 TestCase(const GrShape& shape, skiatest::Reporter* r, SkScalar scale = SK_Scalar1)
273 void testExpectations(skiatest::Reporter* reporter, SelfExpectations expectations) const;
282 void compare(skiatest::Reporter*, const TestCase& that, ComparisonExpecation) const;
295 static void CheckBounds(skiatest::Reporter* r, const GrShape& shape, const SkRect& bounds) {
312 void init(skiatest::Reporter* r, SkScalar scale) {
416 void TestCase::testExpectations(skiatest::Reporter* reporter, SelfExpectations expectations) const {
418 REPORTER_ASSERT(reporter, fBaseKey.count());
420 REPORTER_ASSERT(reporter, fBaseKey != fAppliedPEKey);
421 REPORTER_ASSERT(reporter, expectations.fPEHasValidKey == SkToBool(fAppliedPEKey.count()));
422 REPORTER_ASSERT(reporter, fBaseKey != fAppliedFullKey);
423 REPORTER_ASSERT(reporter, expectations.fPEHasValidKey == SkToBool(fAppliedFullKey.count()));
425 REPORTER_ASSERT(reporter, fAppliedPEKey != fAppliedFullKey);
426 REPORTER_ASSERT(reporter, SkToBool(fAppliedFullKey.count()));
429 REPORTER_ASSERT(reporter, fBaseKey == fAppliedPEKey);
433 reporter, a == b);
435 REPORTER_ASSERT(reporter, fBaseKey != fAppliedFullKey);
437 REPORTER_ASSERT(reporter, fBaseKey == fAppliedFullKey);
454 static void check_equivalence(skiatest::Reporter* r, const GrShape& a, const GrShape& b,
573 void TestCase::compare(skiatest::Reporter* r, const TestCase& that,
613 static void test_basic(skiatest::Reporter* reporter, const Geo& geo) {
619 TestCase fillCase(geo, fill, reporter);
623 fillCase.testExpectations(reporter, expectations);
625 TestCase(geo, fill, reporter).compare(reporter, fillCase,
633 TestCase stroke2RoundBevelCase(geo, stroke2RoundBevel, reporter);
637 stroke2RoundBevelCase.testExpectations(reporter, expectations);
638 TestCase(geo, stroke2RoundBevel, reporter).compare(reporter, stroke2RoundBevelCase,
643 TestCase stroke2RoundBevelDashCase(geo, stroke2RoundBevelDash, reporter);
647 stroke2RoundBevelDashCase.testExpectations(reporter, expectations);
648 TestCase(geo, stroke2RoundBevelDash, reporter).compare(reporter, stroke2RoundBevelDashCase,
652 fillCase.compare(reporter, stroke2RoundBevelCase,
654 fillCase.compare(reporter, stroke2RoundBevelDashCase,
657 fillCase.compare(reporter, stroke2RoundBevelCase,
659 fillCase.compare(reporter, stroke2RoundBevelDashCase,
663 stroke2RoundBevelCase.compare(reporter, stroke2RoundBevelDashCase,
666 stroke2RoundBevelCase.compare(reporter, stroke2RoundBevelDashCase,
673 TestCase stroke2RoundBevelAndFillCase(geo, stroke2RoundBevelAndFill, reporter);
677 stroke2RoundBevelAndFillCase.testExpectations(reporter, expectations);
678 TestCase(geo, stroke2RoundBevelAndFill, reporter).compare(reporter,
683 TestCase stroke2RoundBevelAndFillDashCase(geo, stroke2RoundBevelAndFillDash, reporter);
687 stroke2RoundBevelAndFillDashCase.testExpectations(reporter, expectations);
688 TestCase(geo, stroke2RoundBevelAndFillDash, reporter).compare(
689 reporter, stroke2RoundBevelAndFillDashCase, TestCase::kAllSame_ComparisonExpecation);
690 stroke2RoundBevelAndFillDashCase.compare(reporter, stroke2RoundBevelAndFillCase,
696 TestCase hairlineCase(geo, hairline, reporter);
700 hairlineCase.compare(reporter, fillCase, TestCase::kAllDifferent_ComparisonExpecation);
702 hairlineCase.compare(reporter, fillCase, TestCase::kAllSame_ComparisonExpecation);
704 REPORTER_ASSERT(reporter, hairlineCase.baseShape().style().isSimpleHairline());
705 REPORTER_ASSERT(reporter, hairlineCase.appliedFullStyleShape().style().isSimpleHairline());
706 REPORTER_ASSERT(reporter, hairlineCase.appliedPathEffectShape().style().isSimpleHairline());
710 static void test_scale(skiatest::Reporter* reporter, const Geo& geo) {
717 TestCase fillCase1(geo, fill, reporter, kS1);
718 TestCase fillCase2(geo, fill, reporter, kS2);
720 fillCase1.compare(reporter, fillCase2, TestCase::kAllSame_ComparisonExpecation);
725 TestCase hairlineCase1(geo, hairline, reporter, kS1);
726 TestCase hairlineCase2(geo, hairline, reporter, kS2);
728 hairlineCase1.compare(reporter, hairlineCase2, TestCase::kAllSame_ComparisonExpecation);
733 TestCase strokeCase1(geo, stroke, reporter, kS1);
734 TestCase strokeCase2(geo, stroke, reporter, kS2);
737 REPORTER_ASSERT(reporter, !strokeCase1.baseShape().style().applies());
738 strokeCase1.compare(reporter, strokeCase2, TestCase::kAllSame_ComparisonExpecation);
740 strokeCase1.compare(reporter, strokeCase2, TestCase::kSameUpToStroke_ComparisonExpecation);
745 TestCase strokeDashCase1(geo, strokeDash, reporter, kS1);
746 TestCase strokeDashCase2(geo, strokeDash, reporter, kS2);
748 strokeDashCase1.compare(reporter, strokeDashCase2,
754 TestCase strokeAndFillCase1(geo, strokeAndFill, reporter, kS1);
755 TestCase strokeAndFillCase2(geo, strokeAndFill, reporter, kS2);
759 TestCase strokeAndFillDashCase1(geo, strokeAndFillDash, reporter, kS1);
760 TestCase strokeAndFillDashCase2(geo, strokeAndFillDash, reporter, kS2);
765 REPORTER_ASSERT(reporter, !strokeAndFillCase1.baseShape().style().applies());
766 strokeAndFillCase1.compare(reporter, strokeAndFillCase2,
768 strokeAndFillDashCase1.compare(reporter, strokeAndFillDashCase2,
771 strokeAndFillCase1.compare(reporter, strokeAndFillCase2,
774 strokeAndFillDashCase1.compare(reporter, strokeAndFillCase1,
776 strokeAndFillDashCase2.compare(reporter, strokeAndFillCase2,
781 static void test_stroke_param_impl(skiatest::Reporter* reporter, const Geo& geo,
796 TestCase strokeACase(geo, strokeA, reporter);
797 TestCase strokeBCase(geo, strokeB, reporter);
802 strokeACase.compare(reporter, strokeBCase,
805 strokeACase.compare(reporter, strokeBCase,
809 strokeACase.compare(reporter, strokeBCase, TestCase::kAllSame_ComparisonExpecation);
816 TestCase strokeAndFillACase(geo, strokeAndFillA, reporter);
817 TestCase strokeAndFillBCase(geo, strokeAndFillB, reporter);
823 strokeAndFillACase.compare(reporter, strokeAndFillBCase,
826 strokeAndFillACase.compare(reporter, strokeAndFillBCase,
830 strokeAndFillACase.compare(reporter, strokeAndFillBCase,
838 TestCase fillACase(geo, fillA, reporter);
839 TestCase fillBCase(geo, fillB, reporter);
840 fillACase.compare(reporter, fillBCase, TestCase::kAllSame_ComparisonExpecation);
847 TestCase dashACase(geo, dashA, reporter);
848 TestCase dashBCase(geo, dashB, reporter);
850 dashACase.compare(reporter, dashBCase, TestCase::kSameUpToStroke_ComparisonExpecation);
852 dashACase.compare(reporter, dashBCase, TestCase::kAllSame_ComparisonExpecation);
857 static void test_stroke_param(skiatest::Reporter* reporter, const Geo& geo,
859 test_stroke_param_impl(reporter, geo, setter, a, b, true, true);
862 static void test_stroke_cap(skiatest::Reporter* reporter, const Geo& geo) {
872 reporter,
884 static void test_stroke_join(skiatest::Reporter* reporter, const Geo& geo) {
895 reporter,
902 static void test_miter_limit(skiatest::Reporter* reporter, const Geo& geo) {
922 reporter,
932 reporter,
940 static void test_dash_fill(skiatest::Reporter* reporter, const Geo& geo) {
946 TestCase dashFillCase(geo, dashFill, reporter);
948 TestCase fillCase(geo, SkPaint(), reporter);
949 dashFillCase.compare(reporter, fillCase, TestCase::kAllSame_ComparisonExpecation);
953 void test_null_dash(skiatest::Reporter* reporter, const Geo& geo) {
967 TestCase fillCase(geo, fill, reporter);
968 TestCase strokeCase(geo, stroke, reporter);
969 TestCase dashCase(geo, dash, reporter);
970 TestCase nullDashCase(geo, nullDash, reporter);
973 nullDashCase.compare(reporter, strokeCase, TestCase::kAllSame_ComparisonExpecation);
977 nullDashCase.compare(reporter, fillCase, TestCase::kAllDifferent_ComparisonExpecation);
979 nullDashCase.compare(reporter, fillCase, TestCase::kSameUpToStroke_ComparisonExpecation);
983 nullDashCase.compare(reporter, dashCase, TestCase::kAllDifferent_ComparisonExpecation);
985 nullDashCase.compare(reporter, dashCase, TestCase::kSameUpToPE_ComparisonExpecation);
989 void test_path_effect_makes_rrect(skiatest::Reporter* reporter, const Geo& geo) {
1018 TestCase fillGeoCase(geo, fill, reporter);
1022 TestCase geoPECase(geo, pe, reporter);
1028 TestCase geoPEStrokeCase(geo, peStroke, reporter);
1033 fillGeoCase.compare(reporter, geoPECase, TestCase::kAllDifferent_ComparisonExpecation);
1034 fillGeoCase.compare(reporter, geoPEStrokeCase,
1037 fillGeoCase.compare(reporter, geoPECase, TestCase::kSameUpToPE_ComparisonExpecation);
1038 fillGeoCase.compare(reporter, geoPEStrokeCase, TestCase::kSameUpToPE_ComparisonExpecation);
1040 geoPECase.compare(reporter, geoPEStrokeCase,
1043 TestCase rrectFillCase(reporter, RRectPathEffect::RRect(), fill);
1046 TestCase rrectStrokeCase(reporter, RRectPathEffect::RRect(), stroke);
1051 REPORTER_ASSERT(reporter, geoPECase.appliedPathEffectShape().asRRect(&rrect, nullptr, nullptr,
1053 REPORTER_ASSERT(reporter, rrect == RRectPathEffect::RRect());
1054 REPORTER_ASSERT(reporter, geoPECase.appliedPathEffectKey() == rrectFillCase.baseKey());
1056 REPORTER_ASSERT(reporter, geoPECase.appliedFullStyleShape().asRRect(&rrect, nullptr, nullptr,
1058 REPORTER_ASSERT(reporter, rrect == RRectPathEffect::RRect());
1059 REPORTER_ASSERT(reporter, geoPECase.appliedFullStyleKey() == rrectFillCase.baseKey());
1062 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedPathEffectShape().asRRect(&rrect, nullptr,
1064 REPORTER_ASSERT(reporter, rrect == RRectPathEffect::RRect());
1065 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedPathEffectKey() == rrectFillCase.baseKey());
1067 REPORTER_ASSERT(reporter, !geoPEStrokeCase.appliedFullStyleShape().asRRect(&rrect, nullptr,
1069 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedFullStyleKey() ==
1073 void test_unknown_path_effect(skiatest::Reporter* reporter, const Geo& geo) {
1107 TestCase geoPEStrokeCase(geo, peStroke, reporter);
1112 geoPEStrokeCase.testExpectations(reporter, expectations);
1115 void test_make_hairline_path_effect(skiatest::Reporter* reporter, const Geo& geo) {
1141 TestCase peCase(geo, pe, reporter);
1152 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1153 REPORTER_ASSERT(reporter, paths_fill_same(a, c));
1160 REPORTER_ASSERT(reporter, a == b);
1161 REPORTER_ASSERT(reporter, a == c);
1163 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1164 REPORTER_ASSERT(reporter, paths_fill_same(a, c));
1165 REPORTER_ASSERT(reporter, peCase.appliedPathEffectKey().empty());
1166 REPORTER_ASSERT(reporter, peCase.appliedFullStyleKey().empty());
1168 REPORTER_ASSERT(reporter, peCase.appliedPathEffectShape().style().isSimpleHairline());
1169 REPORTER_ASSERT(reporter, peCase.appliedFullStyleShape().style().isSimpleHairline());
1172 void test_volatile_path(skiatest::Reporter* reporter, const Geo& geo) {
1180 TestCase volatileCase(reporter, vPath, dashAndStroke);
1184 REPORTER_ASSERT(reporter, SkToBool(volatileCase.baseKey().count()));
1186 TestCase nonVolatileCase(reporter, geo.path(), dashAndStroke);
1187 volatileCase.compare(reporter, nonVolatileCase, TestCase::kAllSame_ComparisonExpecation);
1190 REPORTER_ASSERT(reporter, !SkToBool(volatileCase.baseKey().count()));
1191 REPORTER_ASSERT(reporter, !SkToBool(volatileCase.appliedPathEffectKey().count()));
1192 REPORTER_ASSERT(reporter, !SkToBool(volatileCase.appliedFullStyleKey().count()));
1193 REPORTER_ASSERT(reporter, !SkToBool(volatileCase.appliedPathEffectThenStrokeKey().count()));
1197 void test_path_effect_makes_empty_shape(skiatest::Reporter* reporter, const Geo& geo) {
1222 REPORTER_ASSERT(reporter, emptyShape.isEmpty());
1226 TestCase geoCase(geo, pe, reporter);
1227 REPORTER_ASSERT(reporter, geoCase.appliedFullStyleKey() == emptyKey);
1228 REPORTER_ASSERT(reporter, geoCase.appliedPathEffectKey() == emptyKey);
1229 REPORTER_ASSERT(reporter, geoCase.appliedPathEffectThenStrokeKey() == emptyKey);
1230 REPORTER_ASSERT(reporter, geoCase.appliedPathEffectShape().isEmpty());
1231 REPORTER_ASSERT(reporter, geoCase.appliedFullStyleShape().isEmpty());
1237 TestCase geoPEStrokeCase(geo, peStroke, reporter);
1238 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedFullStyleKey() == emptyKey);
1239 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedPathEffectKey() == emptyKey);
1240 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedPathEffectThenStrokeKey() == emptyKey);
1241 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedPathEffectShape().isEmpty());
1242 REPORTER_ASSERT(reporter, geoPEStrokeCase.appliedFullStyleShape().isEmpty());
1245 void test_path_effect_fails(skiatest::Reporter* reporter, const Geo& geo) {
1266 TestCase fillCase(geo, fill, reporter);
1270 TestCase peCase(geo, pe, reporter);
1275 TestCase strokeCase(geo, stroke, reporter);
1279 TestCase peStrokeCase(geo, peStroke, reporter);
1292 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1296 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1300 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1304 REPORTER_ASSERT(reporter, paths_fill_same(a, b));
1307 void test_empty_shape(skiatest::Reporter* reporter) {
1310 TestCase fillEmptyCase(reporter, emptyPath, fill);
1311 REPORTER_ASSERT(reporter, fillEmptyCase.baseShape().isEmpty());
1312 REPORTER_ASSERT(reporter, fillEmptyCase.appliedPathEffectShape().isEmpty());
1313 REPORTER_ASSERT(reporter, fillEmptyCase.appliedFullStyleShape().isEmpty());
1316 REPORTER_ASSERT(reporter, emptyKey.count());
1321 fillEmptyCase.testExpectations(reporter, expectations);
1328 TestCase strokeEmptyCase(reporter, emptyPath2, stroke);
1329 strokeEmptyCase.compare(reporter, fillEmptyCase, TestCase::kAllSame_ComparisonExpecation);
1337 TestCase dashAndStrokeEmptyCase(reporter, emptyPath3, dashAndStroke);
1338 dashAndStrokeEmptyCase.compare(reporter, fillEmptyCase,
1343 REPORTER_ASSERT(reporter, emptyRRect.getType() == SkRRect::kEmpty_Type);
1344 TestCase dashAndStrokeEmptyRRectCase(reporter, emptyRRect, dashAndStroke);
1345 dashAndStrokeEmptyRRectCase.compare(reporter, fillEmptyCase,
1350 TestCase dashAndStrokeEmptyRectCase(reporter, emptyRect, dashAndStroke);
1351 dashAndStrokeEmptyRectCase.compare(reporter, fillEmptyCase,
1368 void test_rrect(skiatest::Reporter* r, const SkRRect& rrect) {
1612 void test_lines(skiatest::Reporter* r) {
1720 static void test_stroked_lines(skiatest::Reporter* r) {
1777 static void test_short_path_keys(skiatest::Reporter* r) {
1841 DEF_TEST(GrShape, reporter) {
1863 test_rrect(reporter, rr);
1910 test_basic(reporter, *geos[i]);
1911 test_scale(reporter, *geos[i]);
1912 test_dash_fill(reporter, *geos[i]);
1913 test_null_dash(reporter, *geos[i]);
1916 reporter, *geos[i],
1919 test_stroke_join(reporter, *geos[i]);
1920 test_stroke_cap(reporter, *geos[i]);
1921 test_miter_limit(reporter, *geos[i]);
1922 test_path_effect_makes_rrect(reporter, *geos[i]);
1923 test_unknown_path_effect(reporter, *geos[i]);
1924 test_path_effect_makes_empty_shape(reporter, *geos[i]);
1925 test_path_effect_fails(reporter, *geos[i]);
1926 test_make_hairline_path_effect(reporter, *geos[i]);
1927 test_volatile_path(reporter, *geos[i]);
1933 TestCase fillPathCase(reporter, rrgeo.path(), fillPaint);
1935 REPORTER_ASSERT(reporter, rrgeo.isNonPath(fillPaint) ==
1939 TestCase fillPathCase2(reporter, rrgeo.path(), fillPaint);
1940 REPORTER_ASSERT(reporter, rrect == rrgeo.rrect());
1941 TestCase fillRRectCase(reporter, rrect, fillPaint);
1942 fillPathCase2.compare(reporter, fillRRectCase,
1948 TestCase strokePathCase(reporter, rrgeo.path(), strokePaint);
1950 REPORTER_ASSERT(reporter, strokePathCase.baseShape().asRRect(&rrect, nullptr, nullptr,
1952 REPORTER_ASSERT(reporter, rrect == rrgeo.rrect());
1953 TestCase strokeRRectCase(reporter, rrect, strokePaint);
1954 strokePathCase.compare(reporter, strokeRRectCase,
1960 test_volatile_path(reporter, PathGeo(SkPath(), PathGeo::Invert::kNo));
1962 test_empty_shape(reporter);
1964 test_lines(reporter);
1966 test_stroked_lines(reporter);
1968 test_short_path_keys(reporter);