Lines Matching refs:reporter
12 static void test_tricky_radii(skiatest::Reporter* reporter) { in test_tricky_radii() argument
31 REPORTER_ASSERT(reporter, (double) rr.radii(SkRRect::kUpperRight_Corner).fY + in test_tricky_radii()
37 static void test_empty_crbug_458524(skiatest::Reporter* reporter) { in test_empty_crbug_458524() argument
47 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == other.getType()); in test_empty_crbug_458524()
52 static void test_empty(skiatest::Reporter* reporter) { in test_empty() argument
72 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
75 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
78 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
81 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
84 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
89 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
92 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
95 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
98 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
101 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
108 static void test_inset(skiatest::Reporter* reporter) { in test_inset() argument
114 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
117 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
120 REPORTER_ASSERT(reporter, rr2.isEmpty()); in test_inset()
124 REPORTER_ASSERT(reporter, rr2.isSimple()); in test_inset()
126 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
130 static void test_9patch_rrect(skiatest::Reporter* reporter, in test_9patch_rrect() argument
137 REPORTER_ASSERT(reporter, SkRRect::kNinePatch_Type == rr.type()); in test_9patch_rrect()
138 REPORTER_ASSERT(reporter, rr.rect() == rect); in test_9patch_rrect()
146 REPORTER_ASSERT(reporter, rquad[i] == rr.radii((SkRRect::Corner) i)); in test_9patch_rrect()
152 REPORTER_ASSERT(reporter, rr2 == rr && rr2.getType() == rr.getType()); in test_9patch_rrect()
156 static void test_round_rect_basic(skiatest::Reporter* reporter) { in test_round_rect_basic() argument
163 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type()); in test_round_rect_basic()
164 REPORTER_ASSERT(reporter, empty.rect().isEmpty()); in test_round_rect_basic()
167 REPORTER_ASSERT(reporter, zeroPt == empty.radii((SkRRect::Corner) i)); in test_round_rect_basic()
176 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type()); in test_round_rect_basic()
177 REPORTER_ASSERT(reporter, rr1.rect() == rect); in test_round_rect_basic()
180 REPORTER_ASSERT(reporter, zeroPt == rr1.radii((SkRRect::Corner) i)); in test_round_rect_basic()
185 REPORTER_ASSERT(reporter, rr1_2 == rr1 && rr1_2.getType() == rr1.getType()); in test_round_rect_basic()
188 REPORTER_ASSERT(reporter, rr1_3 == rr1 && rr1_3.getType() == rr1.getType()); in test_round_rect_basic()
195 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr2.type()); in test_round_rect_basic()
196 REPORTER_ASSERT(reporter, rr2.rect() == rect); in test_round_rect_basic()
199 REPORTER_ASSERT(reporter, in test_round_rect_basic()
206 REPORTER_ASSERT(reporter, rr2_2 == rr2 && rr2_2.getType() == rr2.getType()); in test_round_rect_basic()
209 REPORTER_ASSERT(reporter, rr2_3 == rr2 && rr2_3.getType() == rr2.getType()); in test_round_rect_basic()
216 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr3.type()); in test_round_rect_basic()
217 REPORTER_ASSERT(reporter, rr3.rect() == rect); in test_round_rect_basic()
220 REPORTER_ASSERT(reporter, p == rr3.radii((SkRRect::Corner) i)); in test_round_rect_basic()
225 REPORTER_ASSERT(reporter, rr3_2 == rr3 && rr3_2.getType() == rr3.getType()); in test_round_rect_basic()
228 REPORTER_ASSERT(reporter, rr3_3 == rr3 && rr3_3.getType() == rr3.getType()); in test_round_rect_basic()
231 test_9patch_rrect(reporter, rect, 10, 9, 8, 7, true); in test_round_rect_basic()
237 test_9patch_rrect(reporter, in test_round_rect_basic()
249 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr5.type()); in test_round_rect_basic()
250 REPORTER_ASSERT(reporter, rr5.rect() == rect); in test_round_rect_basic()
253 REPORTER_ASSERT(reporter, radii2[i] == rr5.radii((SkRRect::Corner) i)); in test_round_rect_basic()
257 REPORTER_ASSERT(reporter, empty != rr3); in test_round_rect_basic()
258 REPORTER_ASSERT(reporter, rr3 != rr5); in test_round_rect_basic()
262 static void test_round_rect_rects(skiatest::Reporter* reporter) { in test_round_rect_rects() argument
270 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type()); in test_round_rect_rects()
272 REPORTER_ASSERT(reporter, 0 == r.fLeft && 0 == r.fTop && 0 == r.fRight && 0 == r.fBottom); in test_round_rect_rects()
279 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type()); in test_round_rect_rects()
281 REPORTER_ASSERT(reporter, rect == r); in test_round_rect_rects()
289 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type()); in test_round_rect_rects()
291 REPORTER_ASSERT(reporter, rect == r); in test_round_rect_rects()
298 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr3.type()); in test_round_rect_rects()
302 static void test_round_rect_ovals(skiatest::Reporter* reporter) { in test_round_rect_ovals() argument
309 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type()); in test_round_rect_ovals()
311 REPORTER_ASSERT(reporter, oval == rect); in test_round_rect_ovals()
315 static void test_round_rect_general(skiatest::Reporter* reporter) { in test_round_rect_general() argument
321 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type()); in test_round_rect_general()
329 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type()); in test_round_rect_general()
333 static void test_round_rect_iffy_parameters(skiatest::Reporter* reporter) { in test_round_rect_iffy_parameters() argument
343 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr1.type()); in test_round_rect_iffy_parameters()
347 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fX, 33.33333f)); in test_round_rect_iffy_parameters()
348 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fY, 66.66666f)); in test_round_rect_iffy_parameters()
354 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type()); in test_round_rect_iffy_parameters()
358 REPORTER_ASSERT(reporter, 0.0f == p2.fX); in test_round_rect_iffy_parameters()
359 REPORTER_ASSERT(reporter, 0.0f == p2.fY); in test_round_rect_iffy_parameters()
364 static void test_direction(skiatest::Reporter* reporter, const SkRRect &rr, in test_direction() argument
374 REPORTER_ASSERT(reporter, contains[i] == rr.contains(test)); in test_direction()
382 static void test_round_rect_contains_rect(skiatest::Reporter* reporter) { in test_round_rect_contains_rect() argument
412 REPORTER_ASSERT(reporter, !rrects[i].contains(easyOuts[j])); in test_round_rect_contains_rect()
485 test_direction(reporter, rrects[i], 0, 1, 0, 1, kNumSteps, answers[i][0]); // NW in test_round_rect_contains_rect()
486 test_direction(reporter, rrects[i], 19.5f, 0, 0, 1, kNumSteps, answers[i][1]); // N in test_round_rect_contains_rect()
487 test_direction(reporter, rrects[i], 40, -1, 0, 1, kNumSteps, answers[i][2]); // NE in test_round_rect_contains_rect()
488 test_direction(reporter, rrects[i], 40, -1, 19.5f, 0, kNumSteps, answers[i][3]); // E in test_round_rect_contains_rect()
489 test_direction(reporter, rrects[i], 40, -1, 40, -1, kNumSteps, answers[i][4]); // SE in test_round_rect_contains_rect()
490 test_direction(reporter, rrects[i], 19.5f, 0, 40, -1, kNumSteps, answers[i][5]); // S in test_round_rect_contains_rect()
491 test_direction(reporter, rrects[i], 0, 1, 40, -1, kNumSteps, answers[i][6]); // SW in test_round_rect_contains_rect()
492 test_direction(reporter, rrects[i], 0, 1, 19.5f, 0, kNumSteps, answers[i][7]); // W in test_round_rect_contains_rect()
497 static void assert_transform_failure(skiatest::Reporter* reporter, const SkRRect& orig, in assert_transform_failure() argument
508 REPORTER_ASSERT(reporter, !success); in assert_transform_failure()
510 REPORTER_ASSERT(reporter, copyOfDst == dst); in assert_transform_failure()
512 REPORTER_ASSERT(reporter, copyOfOrig == orig); in assert_transform_failure()
513 REPORTER_ASSERT(reporter, orig != dst); in assert_transform_failure()
527 static void test_transform_helper(skiatest::Reporter* reporter, const SkRRect& orig) { in test_transform_helper() argument
533 REPORTER_ASSERT(reporter, success); in test_transform_helper()
534 REPORTER_ASSERT(reporter, orig == dst); in test_transform_helper()
540 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
544 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
548 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
552 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
557 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
559 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
569 REPORTER_ASSERT(reporter, success); in test_transform_helper()
571 REPORTER_ASSERT(reporter, in test_transform_helper()
574 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
575 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
576 REPORTER_ASSERT(reporter, dst.rect().left() == orig.rect().left() + translateX); in test_transform_helper()
577 REPORTER_ASSERT(reporter, dst.rect().top() == orig.rect().top() + translateY); in test_transform_helper()
581 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
588 REPORTER_ASSERT(reporter, success); in test_transform_helper()
592 REPORTER_ASSERT(reporter, origUL == dstUR); in test_transform_helper()
593 REPORTER_ASSERT(reporter, origUR == dstUL); in test_transform_helper()
594 REPORTER_ASSERT(reporter, origLR == dstLL); in test_transform_helper()
595 REPORTER_ASSERT(reporter, origLL == dstLR); in test_transform_helper()
598 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
599 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
601 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left()); in test_transform_helper()
603 REPORTER_ASSERT(reporter, orig.rect().top() == dst.rect().top()); in test_transform_helper()
607 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
614 REPORTER_ASSERT(reporter, success); in test_transform_helper()
618 REPORTER_ASSERT(reporter, origUL == dstLL); in test_transform_helper()
619 REPORTER_ASSERT(reporter, origUR == dstLR); in test_transform_helper()
620 REPORTER_ASSERT(reporter, origLR == dstUR); in test_transform_helper()
621 REPORTER_ASSERT(reporter, origLL == dstUL); in test_transform_helper()
624 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
625 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
627 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom()); in test_transform_helper()
629 REPORTER_ASSERT(reporter, orig.rect().left() == dst.rect().left()); in test_transform_helper()
637 REPORTER_ASSERT(reporter, success); in test_transform_helper()
640 REPORTER_ASSERT(reporter, origUL == dstLR); in test_transform_helper()
641 REPORTER_ASSERT(reporter, origUR == dstLL); in test_transform_helper()
642 REPORTER_ASSERT(reporter, origLR == dstUL); in test_transform_helper()
643 REPORTER_ASSERT(reporter, origLL == dstUR); in test_transform_helper()
646 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
647 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
648 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom()); in test_transform_helper()
649 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left()); in test_transform_helper()
659 REPORTER_ASSERT(reporter, success); in test_transform_helper()
662 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fX, in test_transform_helper()
664 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fY, in test_transform_helper()
667 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().width(), in test_transform_helper()
669 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().height(), in test_transform_helper()
671 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().left(), in test_transform_helper()
673 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().top(), in test_transform_helper()
677 static void test_round_rect_transform(skiatest::Reporter* reporter) { in test_round_rect_transform() argument
682 test_transform_helper(reporter, rrect); in test_round_rect_transform()
692 test_transform_helper(reporter, rrect); in test_round_rect_transform()
700 static void test_issue_2696(skiatest::Reporter* reporter) { in test_issue_2696() argument
712 REPORTER_ASSERT(reporter, success); in test_issue_2696()
718 REPORTER_ASSERT(reporter, in test_issue_2696()
720 REPORTER_ASSERT(reporter, in test_issue_2696()
725 DEF_TEST(RoundRect, reporter) { in DEF_TEST() argument
726 test_round_rect_basic(reporter); in DEF_TEST()
727 test_round_rect_rects(reporter); in DEF_TEST()
728 test_round_rect_ovals(reporter); in DEF_TEST()
729 test_round_rect_general(reporter); in DEF_TEST()
730 test_round_rect_iffy_parameters(reporter); in DEF_TEST()
731 test_inset(reporter); in DEF_TEST()
732 test_round_rect_contains_rect(reporter); in DEF_TEST()
733 test_round_rect_transform(reporter); in DEF_TEST()
734 test_issue_2696(reporter); in DEF_TEST()
735 test_tricky_radii(reporter); in DEF_TEST()
736 test_empty_crbug_458524(reporter); in DEF_TEST()
737 test_empty(reporter); in DEF_TEST()