Lines Matching defs:reporter
347 bool checkImage(skiatest::Reporter* reporter, sk_sp<SkSurface> s) {
361 [reporter](int x, int y, const float diffs[4]) {
363 ERRORF(reporter, "mismatch at %d, %d (%f, %f, %f %f)",
370 bool checkImage(skiatest::Reporter* reporter) {
371 return this->checkImage(reporter, fDst);
374 bool checkImage(skiatest::Reporter* reporter, sk_sp<SkDeferredDisplayList> ddl) {
386 return this->checkImage(reporter, std::move(tmp));
739 static void test_1(GrDirectContext* dContext, skiatest::Reporter* reporter,
746 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
750 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
753 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
754 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 0);
755 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 0);
756 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 1);
758 helper.checkImage(reporter, helper.snap1());
759 helper.checkImage(reporter, helper.snap2());
762 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache1View, reporter, ctxInfo) {
763 test_1(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
766 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache1Verts, reporter, ctxInfo) {
767 test_1(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
772 static void test_2(GrDirectContext* dContext, skiatest::Reporter* reporter,
779 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
783 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
787 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
790 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
791 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
792 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 1);
793 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
795 helper.checkImage(reporter);
796 helper.checkImage(reporter, helper.snap1());
797 helper.checkImage(reporter, helper.snap2());
800 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache2View, reporter, ctxInfo) {
801 test_2(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
804 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache2Verts, reporter, ctxInfo) {
805 test_2(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
809 static void test_3(GrDirectContext* dContext, skiatest::Reporter* reporter,
816 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
820 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
823 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
824 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
825 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 0);
826 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 1);
828 helper.checkImage(reporter);
829 helper.checkImage(reporter, helper.snap1());
832 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache3View, reporter, ctxInfo) {
833 test_3(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
836 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache3Verts, reporter, ctxInfo) {
837 test_3(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
842 static void test_4(GrDirectContext* dContext, skiatest::Reporter* reporter,
849 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
854 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
857 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
858 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 0);
859 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 0);
860 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 2);
862 helper.checkImage(reporter, helper.snap1());
863 helper.checkImage(reporter, helper.snap2());
866 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4View, reporter, ctxInfo) {
867 test_4(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
870 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4Verts, reporter, ctxInfo) {
871 test_4(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
876 static void test_4_5(GrDirectContext* dContext, skiatest::Reporter* reporter,
883 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
886 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
887 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
888 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 1);
889 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
893 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
896 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
897 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
898 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 1);
899 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 1);
901 helper.checkImage(reporter);
902 helper.checkImage(reporter, helper.snap1());
905 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4_5View, reporter, ctxInfo) {
906 test_4_5(ctxInfo.directContext(), reporter,
910 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4_5Verts, reporter, ctxInfo) {
911 test_4_5(ctxInfo.directContext(), reporter,
917 static void test_4_75(GrDirectContext* dContext, skiatest::Reporter* reporter,
925 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
928 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
929 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
930 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 0);
931 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
936 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
939 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
940 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
941 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 0);
942 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
945 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4_75View, reporter, ctxInfo) {
946 test_4_75(ctxInfo.directContext(), reporter,
950 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache4_75Verts, reporter, ctxInfo) {
951 test_4_75(ctxInfo.directContext(), reporter,
956 static void test_5(GrDirectContext* dContext, skiatest::Reporter* reporter,
975 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(),
984 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache5View, reporter, ctxInfo) {
985 test_5(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
988 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache5Verts, reporter, ctxInfo) {
989 test_5(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
994 static void test_6(GrDirectContext* dContext, skiatest::Reporter* reporter,
1002 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1007 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1010 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1013 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1017 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1021 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1023 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1027 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache6View, reporter, ctxInfo) {
1028 test_6(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1031 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache6Verts, reporter, ctxInfo) {
1032 test_6(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1037 static void test_7(GrDirectContext* dContext, skiatest::Reporter* reporter,
1045 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, kImageWH,
1050 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, 2*kImageWH,
1053 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1056 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1061 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1062 REPORTER_ASSERT(reporter, (helper.*check)(nullptr, 2*kImageWH,
1066 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1071 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache7View, reporter, ctxInfo) {
1072 test_7(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1075 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache7Verts, reporter, ctxInfo) {
1076 test_7(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1082 static void test_8(GrDirectContext* dContext, skiatest::Reporter* reporter,
1089 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1094 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1098 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
1101 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1102 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
1103 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 1);
1104 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
1110 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1116 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache8View, reporter, ctxInfo) {
1117 test_8(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1120 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache8Verts, reporter, ctxInfo) {
1121 test_8(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1127 static void test_9(GrDirectContext* dContext, skiatest::Reporter* reporter,
1134 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1139 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1143 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
1146 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1147 REPORTER_ASSERT(reporter, helper.stats()->fNumLazyCreations == 1);
1148 REPORTER_ASSERT(reporter, helper.stats()->fNumHWCreations == 1);
1149 REPORTER_ASSERT(reporter, helper.stats()->fNumSWCreations == 0);
1155 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1161 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache9View, reporter, ctxInfo) {
1162 test_9(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1165 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache9Verts, reporter, ctxInfo) {
1166 test_9(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1172 static void test_10(GrDirectContext* dContext, skiatest::Reporter* reporter,
1185 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1190 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1194 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1199 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), 2*kImageWH,
1211 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1212 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1214 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1229 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1231 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1235 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache10View, reporter, ctxInfo) {
1236 test_10(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1242 //DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache10Verts, reporter, ctxInfo) {
1243 // test_10(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1249 static void test_11(GrDirectContext* dContext, skiatest::Reporter* reporter,
1256 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1260 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1266 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1267 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1269 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1275 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1279 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1282 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache11View, reporter, ctxInfo) {
1283 test_11(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1286 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache11Verts, reporter, ctxInfo) {
1287 test_11(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1293 static void test_12(GrDirectContext* dContext, skiatest::Reporter* reporter,
1300 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1304 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1308 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1314 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1315 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), kImageWH,
1317 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1322 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1329 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1332 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache12View, reporter, ctxInfo) {
1333 test_12(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1336 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache12Verts, reporter, ctxInfo) {
1337 test_12(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1341 static void test_13(GrDirectContext* dContext, skiatest::Reporter* reporter,
1348 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1358 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), 2*kImageWH,
1365 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 2);
1372 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1373 REPORTER_ASSERT(reporter, (helper.*check)(helper.liveCanvas(), 2*kImageWH,
1377 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache13View, reporter, ctxInfo) {
1378 test_13(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView);
1381 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache13Verts, reporter, ctxInfo) {
1382 test_13(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert);
1387 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache14, reporter, ctxInfo) {
1402 REPORTER_ASSERT(reporter, helper.checkView(ddlCanvas, wh,
1407 REPORTER_ASSERT(reporter, helper.checkVert(ddlCanvas, wh,
1422 static void test_15(GrDirectContext* dContext, skiatest::Reporter* reporter,
1430 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas1(), kImageWH,
1434 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1447 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 0);
1450 REPORTER_ASSERT(reporter, (helper.*check)(helper.ddlCanvas2(), kImageWH,
1454 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1456 helper.checkImage(reporter, std::move(ddl1));
1457 helper.checkImage(reporter, std::move(ddl2));
1460 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache15View, reporter, ctxInfo) {
1461 test_15(ctxInfo.directContext(), reporter, &TestHelper::addViewAccess, &TestHelper::checkView,
1465 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache15Verts, reporter, ctxInfo) {
1466 test_15(ctxInfo.directContext(), reporter, &TestHelper::addVertAccess, &TestHelper::checkVert,
1480 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrThreadSafeCache16Verts, reporter, ctxInfo) {
1489 REPORTER_ASSERT(reporter, helper.checkVert(helper.ddlCanvas1(), kImageWH,
1494 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1496 REPORTER_ASSERT(reporter, vertexData.get() == op1->vertexData());
1500 REPORTER_ASSERT(reporter, helper.checkVert(helper.ddlCanvas2(), kImageWH,
1504 REPORTER_ASSERT(reporter, op1->vertexData() != op2->vertexData());
1507 REPORTER_ASSERT(reporter, helper.numCacheEntries() == 1);
1509 REPORTER_ASSERT(reporter, vertexData.get() == op2->vertexData());
1512 helper.checkImage(reporter, std::move(ddl1));
1513 helper.checkImage(reporter, std::move(ddl2));