Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

24 static void test_assign_and_comparison(skiatest::Reporter* reporter) {
28 REPORTER_ASSERT(reporter, 0 == s.getSaveCount());
32 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
42 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
50 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
57 REPORTER_ASSERT(reporter, s == copy);
61 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
62 REPORTER_ASSERT(reporter, s != copy);
66 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
69 REPORTER_ASSERT(reporter, s == copy);
73 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
75 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
78 REPORTER_ASSERT(reporter, s != copy);
86 REPORTER_ASSERT(reporter, s == copy);
90 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
92 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
96 REPORTER_ASSERT(reporter, s != copy);
100 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
103 REPORTER_ASSERT(reporter, 2 == copy.getSaveCount());
104 REPORTER_ASSERT(reporter, s == copy);
106 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
108 REPORTER_ASSERT(reporter, 1 == copy.getSaveCount());
109 REPORTER_ASSERT(reporter, s == copy);
113 REPORTER_ASSERT(reporter, 0 == s.getSaveCount());
115 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
119 REPORTER_ASSERT(reporter, s != copy);
122 static void assert_count(skiatest::Reporter* reporter, const SkClipStack& stack,
129 REPORTER_ASSERT(reporter, count == counter);
134 static void test_iterators(skiatest::Reporter* reporter) {
149 assert_count(reporter, stack, 4);
159 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
160 REPORTER_ASSERT(reporter, element->getRect() == gRects[i]);
174 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
175 REPORTER_ASSERT(reporter, element->getRect() == gRects[i]);
188 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
189 REPORTER_ASSERT(reporter, element->getRect() == gRects[3]);
194 static void test_bounds(skiatest::Reporter* reporter, SkClipStack::Element::Type primType) {
284 REPORTER_ASSERT(reporter, !stack.isWideOpen());
285 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID());
291 REPORTER_ASSERT(reporter, isIntersectionOfRects ==
294 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
298 REPORTER_ASSERT(reporter, devClipBound == gAnswerRectsBW[testCase]);
307 static void test_isWideOpen(skiatest::Reporter* reporter) {
311 REPORTER_ASSERT(reporter, stack.isWideOpen());
312 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
324 REPORTER_ASSERT(reporter, stack.isWideOpen());
325 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
343 REPORTER_ASSERT(reporter, stack.isWideOpen());
344 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
353 REPORTER_ASSERT(reporter, stack.isWideOpen());
354 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
366 REPORTER_ASSERT(reporter, stack.isWideOpen());
367 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
378 REPORTER_ASSERT(reporter, !stack.isWideOpen());
379 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID());
383 REPORTER_ASSERT(reporter, stack.isWideOpen());
384 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
402 static void test_rect_inverse_fill(skiatest::Reporter* reporter) {
415 REPORTER_ASSERT(reporter, SkClipStack::kInsideOut_BoundsType == boundsType);
416 REPORTER_ASSERT(reporter, bounds == rect);
419 static void test_rect_replace(skiatest::Reporter* reporter) {
431 REPORTER_ASSERT(reporter, 0 == count(stack));
433 REPORTER_ASSERT(reporter, 1 == count(stack));
435 REPORTER_ASSERT(reporter, 1 == count(stack));
442 REPORTER_ASSERT(reporter, 0 == count(stack));
444 REPORTER_ASSERT(reporter, 1 == count(stack));
446 REPORTER_ASSERT(reporter, 1 == count(stack));
453 REPORTER_ASSERT(reporter, 0 == count(stack));
455 REPORTER_ASSERT(reporter, 1 == count(stack));
457 REPORTER_ASSERT(reporter, 1 == count(stack));
459 REPORTER_ASSERT(reporter, 1 == count(stack));
467 REPORTER_ASSERT(reporter, 1 == count(stack));
471 REPORTER_ASSERT(reporter, 2 == count(stack));
473 REPORTER_ASSERT(reporter, bound == rect);
475 REPORTER_ASSERT(reporter, 1 == count(stack));
480 REPORTER_ASSERT(reporter, 2 == count(stack));
482 REPORTER_ASSERT(reporter, 1 == count(stack));
488 REPORTER_ASSERT(reporter, 2 == count(stack));
490 REPORTER_ASSERT(reporter, 1 == count(stack));
495 static void test_path_replace(skiatest::Reporter* reporter) {
503 REPORTER_ASSERT(reporter, 0 == count(stack));
505 REPORTER_ASSERT(reporter, 1 == count(stack));
507 REPORTER_ASSERT(reporter, 1 == count(stack));
514 REPORTER_ASSERT(reporter, 1 == count(stack));
516 REPORTER_ASSERT(reporter, 1 == count(stack));
522 static void test_rect_merging(skiatest::Reporter* reporter) {
542 REPORTER_ASSERT(reporter, 1 == count(stack));
546 REPORTER_ASSERT(reporter, isIntersectionOfRects);
557 REPORTER_ASSERT(reporter, 1 == count(stack));
561 REPORTER_ASSERT(reporter, isIntersectionOfRects);
572 REPORTER_ASSERT(reporter, 2 == count(stack));
576 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
587 REPORTER_ASSERT(reporter, 1 == count(stack));
591 REPORTER_ASSERT(reporter, isIntersectionOfRects);
602 REPORTER_ASSERT(reporter, 1 == count(stack));
606 REPORTER_ASSERT(reporter, isIntersectionOfRects);
617 REPORTER_ASSERT(reporter, 2 == count(stack));
621 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
625 static void test_quickContains(skiatest::Reporter* reporter) {
645 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
652 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
660 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
669 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
679 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
686 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
692 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
698 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
704 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
711 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
717 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
723 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
729 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
739 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
748 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
757 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
766 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
775 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
783 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
791 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
799 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
824 static void test_invfill_diff_bug(skiatest::Reporter* reporter) {
833 REPORTER_ASSERT(reporter, SkClipStack::kEmptyGenID == stack.getTopmostGenID());
839 REPORTER_ASSERT(reporter, stackBounds.isEmpty());
840 REPORTER_ASSERT(reporter, SkClipStack::kNormal_BoundsType == stackBoundsType);
845 REPORTER_ASSERT(reporter, region.isEmpty());
917 static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
1024 REPORTER_ASSERT_MESSAGE(reporter,
1030 REPORTER_ASSERT_MESSAGE(reporter, reduced->hasIBounds(), testCase.c_str());
1037 REPORTER_ASSERT_MESSAGE(reporter,
1041 REPORTER_ASSERT_MESSAGE(reporter, reduced->requiresAA() == doAA, testCase.c_str());
1067 REPORTER_ASSERT_MESSAGE(reporter, region == reducedRegion, testCase.c_str());
1079 static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) {
1093 REPORTER_ASSERT(reporter, reduced->elements().count() == 1);
1095 REPORTER_ASSERT(reporter, SkClipStack::kInvalidGenID != reduced->elementsGenID());
1177 REPORTER_ASSERT(reporter, reduced.elements().count() == testCases[i].reducedClipCount);
1180 REPORTER_ASSERT(reporter, reduced.elementsGenID() == testCases[i].reducedGenID);
1183 REPORTER_ASSERT(reporter, reduced.initialState() == testCases[i].initialState);
1185 REPORTER_ASSERT(reporter, reduced.hasIBounds());
1187 REPORTER_ASSERT(reporter, reduced.ibounds() == testCases[i].clipIRect);
1193 static void test_reduced_clip_stack_no_aa_crash(skiatest::Reporter* reporter) {
1201 REPORTER_ASSERT(reporter, reduced.elements().isEmpty());
1211 static void test_aa_query(skiatest::Reporter* reporter, const SkString& testName,
1226 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1227 REPORTER_ASSERT_MESSAGE(reporter,
1233 REPORTER_ASSERT_MESSAGE(reporter,
1237 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1238 REPORTER_ASSERT_MESSAGE(reporter,
1247 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1248 REPORTER_ASSERT_MESSAGE(reporter, reduced.hasIBounds(), testName.c_str());
1249 REPORTER_ASSERT_MESSAGE(reporter, expectedScissor == reduced.ibounds(),
1251 REPORTER_ASSERT_MESSAGE(reporter,
1261 REPORTER_ASSERT_MESSAGE(reporter, numExpectedElems == reduced.elements().count(),
1263 REPORTER_ASSERT_MESSAGE(reporter, reduced.hasIBounds(), testName.c_str());
1264 REPORTER_ASSERT_MESSAGE(reporter, expectedClipIBounds == reduced.ibounds(),
1266 REPORTER_ASSERT_MESSAGE(reporter, reduced.requiresAA() == !reduced.elements().isEmpty(),
1273 static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
1297 test_aa_query(reporter, name, stack, m, {IL, IT, IR, IB}, ClipMethod::kIgnoreClip);
1298 test_aa_query(reporter, name, stack, m, {IL, IT-1, IR, IT}, ClipMethod::kSkipDraw);
1299 test_aa_query(reporter, name, stack, m, {IL, IT-2, IR, IB}, ClipMethod::kScissor);
1305 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kIgnoreClip);
1306 test_aa_query(reporter, name, stack, m, {L-.1f, T, L, B}, ClipMethod::kSkipDraw);
1307 test_aa_query(reporter, name, stack, m, {L-.1f, T, L+.1f, B}, ClipMethod::kAAElements, 1);
1313 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kSkipDraw);
1314 test_aa_query(reporter
1315 test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T+.1f}, ClipMethod::kAAElements, 1);
1322 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
1323 test_aa_query(reporter, name, stack, m, {r-.1f, t, R, b}, ClipMethod::kAAElements, 1);
1324 test_aa_query(reporter, name, stack, m, {r-.1f, t, R+.1f, b}, ClipMethod::kAAElements, 2);
1325 test_aa_query(reporter, name, stack, m, {r, t, R+.1f, b}, ClipMethod::kAAElements, 1);
1326 test_aa_query(reporter, name, stack, m, {r, t, R, b}, ClipMethod::kIgnoreClip);
1327 test_aa_query(reporter, name, stack, m, {R, T, R+.1f, B}, ClipMethod::kSkipDraw);
1334 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
1335 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB}, ClipMethod::kAAElements, 1);
1336 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB+.1f}, ClipMethod::kAAElements, 1);
1337 test_aa_query(reporter, name, stack, m, {l, b, r, IB+.1f}, ClipMethod::kAAElements, 0);
1338 test_aa_query(reporter, name, stack, m, {l, b, r, IB}, ClipMethod::kIgnoreClip);
1339 test_aa_query(reporter, name, stack, m, {IL, IB, IR, IB+.1f}, ClipMethod::kSkipDraw);
1361 DEF_TEST(ClipStack, reporter) {
1364 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount());
1365 assert_count(reporter, stack, 0);
1383 REPORTER_ASSERT(reporter, element);
1384 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
1385 REPORTER_ASSERT(reporter, kIntersect_SkClipOp == element->getOp());
1386 REPORTER_ASSERT(reporter, element->getRect() == answer);
1388 REPORTER_ASSERT(reporter, !iter.next());
1391 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount());
1392 assert_count(reporter, stack, 0);
1394 test_assign_and_comparison(reporter);
1395 test_iterators(reporter);
1396 test_bounds(reporter, SkClipStack::Element::kRect_Type);
1397 test_bounds(reporter, SkClipStack::Element::kRRect_Type);
1398 test_bounds(reporter, SkClipStack::Element::kPath_Type);
1399 test_isWideOpen(reporter);
1400 test_rect_merging(reporter);
1401 test_rect_replace(reporter);
1402 test_rect_inverse_fill(reporter);
1403 test_path_replace(reporter);
1404 test_quickContains(reporter);
1405 test_invfill_diff_bug(reporter);
1407 test_reduced_clip_stack(reporter);
1408 test_reduced_clip_stack_genid(reporter);
1409 test_reduced_clip_stack_no_aa_crash(reporter);
1410 test_reduced_clip_stack_aa(reporter);
1423 DEF_GPUTEST_FOR_ALL_CONTEXTS(ClipMaskCache, reporter, ctxInfo) {
1446 REPORTER_ASSERT(reporter, 0 == strcmp(tex->getUniqueKey().tag(), kTag));
1450 REPORTER_ASSERT(reporter, i + 1 == cache->countUniqueKeysWithTag(kTag));
1456 REPORTER_ASSERT(reporter, kN - (i + 1) == cache->countUniqueKeysWithTag(kTag));
1462 DEF_GPUTEST_FOR_ALL_CONTEXTS(canvas_private_clipRgn, reporter, ctxInfo) {
1473 REPORTER_ASSERT(reporter, rgn.isRect());
1474 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeWH(w, h));
1479 REPORTER_ASSERT(reporter, rgn.isComplex());
1480 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeWH(w, h));
1486 REPORTER_ASSERT(reporter, rgn.isComplex());
1487 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeLTRB(3, 3, 7, 7));