Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

26 static void test_assign_and_comparison(skiatest::Reporter* reporter) {
30 REPORTER_ASSERT(reporter, 0 == s.getSaveCount());
34 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
44 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
52 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
59 REPORTER_ASSERT(reporter, s == copy);
63 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
64 REPORTER_ASSERT(reporter, s != copy);
68 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
71 REPORTER_ASSERT(reporter, s == copy);
75 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
77 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
80 REPORTER_ASSERT(reporter, s != copy);
88 REPORTER_ASSERT(reporter, s == copy);
92 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
94 REPORTER_ASSERT(reporter, 3 == s.getSaveCount());
98 REPORTER_ASSERT(reporter, s != copy);
102 REPORTER_ASSERT(reporter, 2 == s.getSaveCount());
105 REPORTER_ASSERT(reporter, 2 == copy.getSaveCount());
106 REPORTER_ASSERT(reporter, s == copy);
108 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
110 REPORTER_ASSERT(reporter, 1 == copy.getSaveCount());
111 REPORTER_ASSERT(reporter, s == copy);
115 REPORTER_ASSERT(reporter, 0 == s.getSaveCount());
117 REPORTER_ASSERT(reporter, 1 == s.getSaveCount());
121 REPORTER_ASSERT(reporter, s != copy);
124 static void assert_count(skiatest::Reporter* reporter, const SkClipStack& stack,
131 REPORTER_ASSERT(reporter, count == counter);
136 static void test_iterators(skiatest::Reporter* reporter) {
151 assert_count(reporter, stack, 4);
161 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
162 REPORTER_ASSERT(reporter, element->getRect() == gRects[i]);
176 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
177 REPORTER_ASSERT(reporter, element->getRect() == gRects[i]);
190 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
191 REPORTER_ASSERT(reporter, element->getRect() == gRects[3]);
196 static void test_bounds(skiatest::Reporter* reporter, SkClipStack::Element::Type primType) {
286 REPORTER_ASSERT(reporter, !stack.isWideOpen());
287 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID());
293 REPORTER_ASSERT(reporter, isIntersectionOfRects ==
296 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
300 REPORTER_ASSERT(reporter, devClipBound == gAnswerRectsBW[testCase]);
309 static void test_isWideOpen(skiatest::Reporter* reporter) {
313 REPORTER_ASSERT(reporter, stack.isWideOpen());
314 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
326 REPORTER_ASSERT(reporter, stack.isWideOpen());
327 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
345 REPORTER_ASSERT(reporter, stack.isWideOpen());
346 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
355 REPORTER_ASSERT(reporter, stack.isWideOpen());
356 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
368 REPORTER_ASSERT(reporter, stack.isWideOpen());
369 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
380 REPORTER_ASSERT(reporter, !stack.isWideOpen());
381 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID());
385 REPORTER_ASSERT(reporter, stack.isWideOpen());
386 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID());
404 static void test_rect_inverse_fill(skiatest::Reporter* reporter) {
417 REPORTER_ASSERT(reporter, SkClipStack::kInsideOut_BoundsType == boundsType);
418 REPORTER_ASSERT(reporter, bounds == rect);
421 static void test_rect_replace(skiatest::Reporter* reporter) {
433 REPORTER_ASSERT(reporter, 0 == count(stack));
435 REPORTER_ASSERT(reporter, 1 == count(stack));
437 REPORTER_ASSERT(reporter, 1 == count(stack));
444 REPORTER_ASSERT(reporter, 0 == count(stack));
446 REPORTER_ASSERT(reporter, 1 == count(stack));
448 REPORTER_ASSERT(reporter, 1 == count(stack));
455 REPORTER_ASSERT(reporter, 0 == count(stack));
457 REPORTER_ASSERT(reporter, 1 == count(stack));
459 REPORTER_ASSERT(reporter, 1 == count(stack));
461 REPORTER_ASSERT(reporter, 1 == count(stack));
469 REPORTER_ASSERT(reporter, 1 == count(stack));
473 REPORTER_ASSERT(reporter, 2 == count(stack));
475 REPORTER_ASSERT(reporter, bound == rect);
477 REPORTER_ASSERT(reporter, 1 == count(stack));
482 REPORTER_ASSERT(reporter, 2 == count(stack));
484 REPORTER_ASSERT(reporter, 1 == count(stack));
490 REPORTER_ASSERT(reporter, 2 == count(stack));
492 REPORTER_ASSERT(reporter, 1 == count(stack));
497 static void test_path_replace(skiatest::Reporterreporter) {
505 REPORTER_ASSERT(reporter, 0 == count(stack));
507 REPORTER_ASSERT(reporter, 1 == count(stack));
509 REPORTER_ASSERT(reporter, 1 == count(stack));
516 REPORTER_ASSERT(reporter, 1 == count(stack));
518 REPORTER_ASSERT(reporter, 1 == count(stack));
524 static void test_rect_merging(skiatest::Reporter* reporter) {
544 REPORTER_ASSERT(reporter, 1 == count(stack));
548 REPORTER_ASSERT(reporter, isIntersectionOfRects);
559 REPORTER_ASSERT(reporter, 1 == count(stack));
563 REPORTER_ASSERT(reporter, isIntersectionOfRects);
574 REPORTER_ASSERT(reporter, 2 == count(stack));
578 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
589 REPORTER_ASSERT(reporter, 1 == count(stack));
593 REPORTER_ASSERT(reporter, isIntersectionOfRects);
604 REPORTER_ASSERT(reporter, 1 == count(stack));
608 REPORTER_ASSERT(reporter, isIntersectionOfRects);
619 REPORTER_ASSERT(reporter, 2 == count(stack));
623 REPORTER_ASSERT(reporter, !isIntersectionOfRects);
627 static void test_quickContains(skiatest::Reporter* reporter) {
647 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
654 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
662 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
671 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
681 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
688 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
694 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
700 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
706 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
713 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
719 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
725 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
731 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
741 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
750 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
759 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
768 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
777 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
785 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
793 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect));
801 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect));
826 static void test_invfill_diff_bug(skiatest::Reporter* reporter) {
835 REPORTER_ASSERT(reporter, SkClipStack::kEmptyGenID == stack.getTopmostGenID());
841 REPORTER_ASSERT(reporter, stackBounds.isEmpty());
842 REPORTER_ASSERT(reporter, SkClipStack::kNormal_BoundsType == stackBoundsType);
847 REPORTER_ASSERT(reporter, region.isEmpty());
919 static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
1026 REPORTER_ASSERT_MESSAGE(reporter,
1032 REPORTER_ASSERT_MESSAGE(reporter, reduced->hasIBounds(), testCase.c_str());
1039 REPORTER_ASSERT_MESSAGE(reporter,
1043 REPORTER_ASSERT_MESSAGE(reporter, reduced->requiresAA() == doAA, testCase.c_str());
1069 REPORTER_ASSERT_MESSAGE(reporter, region == reducedRegion, testCase.c_str());
1081 static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) {
1095 REPORTER_ASSERT(reporter, reduced->elements().count() == 1);
1097 REPORTER_ASSERT(reporter, SkClipStack::kInvalidGenID != reduced->elementsGenID());
1179 REPORTER_ASSERT(reporter, reduced.elements().count() == testCases[i].reducedClipCount);
1182 REPORTER_ASSERT(reporter, reduced.elementsGenID() == testCases[i].reducedGenID);
1185 REPORTER_ASSERT(reporter, reduced.initialState() == testCases[i].initialState);
1187 REPORTER_ASSERT(reporter, reduced.hasIBounds());
1189 REPORTER_ASSERT(reporter, reduced.ibounds() == testCases[i].clipIRect);
1195 static void test_reduced_clip_stack_no_aa_crash(skiatest::Reporter* reporter) {
1203 REPORTER_ASSERT(reporter, reduced.elements().isEmpty());
1213 static void test_aa_query(skiatest::Reporter* reporter, const SkString& testName,
1228 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1229 REPORTER_ASSERT_MESSAGE(reporter,
1235 REPORTER_ASSERT_MESSAGE(reporter,
1239 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1240 REPORTER_ASSERT_MESSAGE(reporter,
1249 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), testName.c_str());
1250 REPORTER_ASSERT_MESSAGE(reporter, reduced.hasIBounds(), testName.c_str());
1251 REPORTER_ASSERT_MESSAGE(reporter, expectedScissor == reduced.ibounds(),
1253 REPORTER_ASSERT_MESSAGE(reporter,
1263 REPORTER_ASSERT_MESSAGE(reporter, numExpectedElems == reduced.elements().count(),
1265 REPORTER_ASSERT_MESSAGE(reporter, reduced.hasIBounds(), testName.c_str());
1266 REPORTER_ASSERT_MESSAGE(reporter, expectedClipIBounds == reduced.ibounds(),
1268 REPORTER_ASSERT_MESSAGE(reporter, reduced.requiresAA() == !reduced.elements().isEmpty(),
1275 static void test_reduced_clip_stack_aa(skiatest::Reporter* reporter) {
1299 test_aa_query(reporter, name, stack, m, {IL, IT, IR, IB}, ClipMethod::kIgnoreClip);
1300 test_aa_query(reporter, name, stack, m, {IL, IT-1, IR, IT}, ClipMethod::kSkipDraw);
1301 test_aa_query(reporter, name, stack, m, {IL, IT-2, IR, IB}, ClipMethod::kScissor);
1307 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kIgnoreClip);
1308 test_aa_query(reporter, name, stack, m, {L-.1f, T, L, B}, ClipMethod::kSkipDraw);
1309 test_aa_query(reporter, name, stack, m, {L-.1f, T, L+.1f, B}, ClipMethod::kAAElements, 1);
1315 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kSkipDraw);
1316 reporter, name, stack, m, {L, T-.1f, R, T}, ClipMethod::kIgnoreClip);
1317 test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T+.1f}, ClipMethod::kAAElements, 1);
1324 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
1325 test_aa_query(reporter, name, stack, m, {r-.1f, t, R, b}, ClipMethod::kAAElements, 1);
1326 test_aa_query(reporter, name, stack, m, {r-.1f, t, R+.1f, b}, ClipMethod::kAAElements, 2);
1327 test_aa_query(reporter, name, stack, m, {r, t, R+.1f, b}, ClipMethod::kAAElements, 1);
1328 test_aa_query(reporter, name, stack, m, {r, t, R, b}, ClipMethod::kIgnoreClip);
1329 test_aa_query(reporter, name, stack, m, {R, T, R+.1f, B}, ClipMethod::kSkipDraw);
1336 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw);
1337 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB}, ClipMethod::kAAElements, 1);
1338 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB+.1f}, ClipMethod::kAAElements, 1);
1339 test_aa_query(reporter, name, stack, m, {l, b, r, IB+.1f}, ClipMethod::kAAElements, 0);
1340 test_aa_query(reporter, name, stack, m, {l, b, r, IB}, ClipMethod::kIgnoreClip);
1341 test_aa_query(reporter, name, stack, m, {IL, IB, IR, IB+.1f}, ClipMethod::kSkipDraw);
1361 static void test_tiny_query_bounds_assertion_bug(skiatest::Reporter* reporter) {
1383 REPORTER_ASSERT(reporter, !reduced.hasIBounds());
1384 REPORTER_ASSERT(reporter, reduced.elements().isEmpty());
1385 REPORTER_ASSERT(reporter,
1393 DEF_TEST(ClipStack, reporter) {
1396 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount());
1397 assert_count(reporter, stack, 0);
1415 REPORTER_ASSERT(reporter, element);
1416 REPORTER_ASSERT(reporter, SkClipStack::Element::kRect_Type == element->getType());
1417 REPORTER_ASSERT(reporter, kIntersect_SkClipOp == element->getOp());
1418 REPORTER_ASSERT(reporter, element->getRect() == answer);
1420 REPORTER_ASSERT(reporter, !iter.next());
1423 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount());
1424 assert_count(reporter, stack, 0);
1426 test_assign_and_comparison(reporter);
1427 test_iterators(reporter);
1428 test_bounds(reporter, SkClipStack::Element::kRect_Type);
1429 test_bounds(reporter, SkClipStack::Element::kRRect_Type);
1430 test_bounds(reporter, SkClipStack::Element::kPath_Type);
1431 test_isWideOpen(reporter);
1432 test_rect_merging(reporter);
1433 test_rect_replace(reporter);
1434 test_rect_inverse_fill(reporter);
1435 test_path_replace(reporter);
1436 test_quickContains(reporter);
1437 test_invfill_diff_bug(reporter);
1439 test_reduced_clip_stack(reporter);
1440 test_reduced_clip_stack_genid(reporter);
1441 test_reduced_clip_stack_no_aa_crash(reporter);
1442 test_reduced_clip_stack_aa(reporter);
1443 test_tiny_query_bounds_assertion_bug(reporter);
1456 DEF_GPUTEST_FOR_ALL_CONTEXTS(ClipMaskCache, reporter, ctxInfo) {
1480 REPORTER_ASSERT(reporter, 0 == strcmp(tex->getUniqueKey().tag(), kTag));
1484 REPORTER_ASSERT(reporter, i + 1 == cache->countUniqueKeysWithTag(kTag));
1490 REPORTER_ASSERT(reporter, kN - (i + 1) == cache->countUniqueKeysWithTag(kTag));
1496 DEF_GPUTEST_FOR_ALL_CONTEXTS(canvas_private_clipRgn, reporter, ctxInfo) {
1507 REPORTER_ASSERT(reporter, rgn.isRect());
1508 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeWH(w, h));
1513 REPORTER_ASSERT(reporter, rgn.isComplex());
1514 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeWH(w, h));
1520 REPORTER_ASSERT(reporter, rgn.isComplex());
1521 REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeLTRB(3, 3, 7, 7));