Lines Matching refs:reporter

13 static void test_tricky_radii(skiatest::Reporter* reporter) {  in test_tricky_radii()  argument
32 REPORTER_ASSERT(reporter, (double) rr.radii(SkRRect::kUpperRight_Corner).fY + in test_tricky_radii()
38 static void test_empty_crbug_458524(skiatest::Reporter* reporter) { in test_empty_crbug_458524() argument
48 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == other.getType()); in test_empty_crbug_458524()
53 static void test_empty(skiatest::Reporter* reporter) { in test_empty() argument
73 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
74 REPORTER_ASSERT(reporter, r.rect() == oooRects[i].makeSorted()); in test_empty()
77 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
78 REPORTER_ASSERT(reporter, r.rect() == oooRects[i].makeSorted()); in test_empty()
81 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
82 REPORTER_ASSERT(reporter, r.rect() == oooRects[i].makeSorted()); in test_empty()
85 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
86 REPORTER_ASSERT(reporter, r.rect() == oooRects[i].makeSorted()); in test_empty()
89 REPORTER_ASSERT(reporter, !r.isEmpty()); in test_empty()
90 REPORTER_ASSERT(reporter, r.rect() == oooRects[i].makeSorted()); in test_empty()
95 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
96 REPORTER_ASSERT(reporter, r.rect() == emptyRects[i]); in test_empty()
99 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
100 REPORTER_ASSERT(reporter, r.rect() == emptyRects[i]); in test_empty()
103 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
104 REPORTER_ASSERT(reporter, r.rect() == emptyRects[i]); in test_empty()
107 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
108 REPORTER_ASSERT(reporter, r.rect() == emptyRects[i]); in test_empty()
111 REPORTER_ASSERT(reporter, r.isEmpty()); in test_empty()
112 REPORTER_ASSERT(reporter, r.rect() == emptyRects[i]); in test_empty()
116 REPORTER_ASSERT(reporter, r == SkRRect::MakeEmpty()); in test_empty()
118 REPORTER_ASSERT(reporter, r == SkRRect::MakeEmpty()); in test_empty()
124 static void test_inset(skiatest::Reporter* reporter) { in test_inset() argument
130 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
133 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
136 REPORTER_ASSERT(reporter, rr2.isEmpty()); in test_inset()
140 REPORTER_ASSERT(reporter, rr2.isSimple()); in test_inset()
142 REPORTER_ASSERT(reporter, rr2.isRect()); in test_inset()
146 static void test_9patch_rrect(skiatest::Reporter* reporter, in test_9patch_rrect() argument
153 REPORTER_ASSERT(reporter, SkRRect::kNinePatch_Type == rr.type()); in test_9patch_rrect()
154 REPORTER_ASSERT(reporter, rr.rect() == rect); in test_9patch_rrect()
162 REPORTER_ASSERT(reporter, rquad[i] == rr.radii((SkRRect::Corner) i)); in test_9patch_rrect()
168 REPORTER_ASSERT(reporter, rr2 == rr && rr2.getType() == rr.getType()); in test_9patch_rrect()
172 static void test_round_rect_basic(skiatest::Reporter* reporter) { in test_round_rect_basic() argument
179 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type()); in test_round_rect_basic()
180 REPORTER_ASSERT(reporter, empty.rect().isEmpty()); in test_round_rect_basic()
183 REPORTER_ASSERT(reporter, zeroPt == empty.radii((SkRRect::Corner) i)); in test_round_rect_basic()
192 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type()); in test_round_rect_basic()
193 REPORTER_ASSERT(reporter, rr1.rect() == rect); in test_round_rect_basic()
196 REPORTER_ASSERT(reporter, zeroPt == rr1.radii((SkRRect::Corner) i)); in test_round_rect_basic()
201 REPORTER_ASSERT(reporter, rr1_2 == rr1 && rr1_2.getType() == rr1.getType()); in test_round_rect_basic()
204 REPORTER_ASSERT(reporter, rr1_3 == rr1 && rr1_3.getType() == rr1.getType()); in test_round_rect_basic()
211 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr2.type()); in test_round_rect_basic()
212 REPORTER_ASSERT(reporter, rr2.rect() == rect); in test_round_rect_basic()
215 REPORTER_ASSERT(reporter, in test_round_rect_basic()
223 REPORTER_ASSERT(reporter, rr2_2 == rr2 && rr2_2.getType() == rr2.getType()); in test_round_rect_basic()
226 REPORTER_ASSERT(reporter, rr2_3 == rr2 && rr2_3.getType() == rr2.getType()); in test_round_rect_basic()
233 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr3.type()); in test_round_rect_basic()
234 REPORTER_ASSERT(reporter, rr3.rect() == rect); in test_round_rect_basic()
237 REPORTER_ASSERT(reporter, p == rr3.radii((SkRRect::Corner) i)); in test_round_rect_basic()
242 REPORTER_ASSERT(reporter, rr3_2 == rr3 && rr3_2.getType() == rr3.getType()); in test_round_rect_basic()
245 REPORTER_ASSERT(reporter, rr3_3 == rr3 && rr3_3.getType() == rr3.getType()); in test_round_rect_basic()
248 test_9patch_rrect(reporter, rect, 10, 9, 8, 7, true); in test_round_rect_basic()
254 test_9patch_rrect(reporter, in test_round_rect_basic()
266 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr5.type()); in test_round_rect_basic()
267 REPORTER_ASSERT(reporter, rr5.rect() == rect); in test_round_rect_basic()
270 REPORTER_ASSERT(reporter, radii2[i] == rr5.radii((SkRRect::Corner) i)); in test_round_rect_basic()
274 REPORTER_ASSERT(reporter, empty != rr3); in test_round_rect_basic()
275 REPORTER_ASSERT(reporter, rr3 != rr5); in test_round_rect_basic()
279 static void test_round_rect_rects(skiatest::Reporter* reporter) { in test_round_rect_rects() argument
287 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type()); in test_round_rect_rects()
289 REPORTER_ASSERT(reporter, 0 == r.fLeft && 0 == r.fTop && 0 == r.fRight && 0 == r.fBottom); in test_round_rect_rects()
296 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type()); in test_round_rect_rects()
298 REPORTER_ASSERT(reporter, rect == r); in test_round_rect_rects()
306 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type()); in test_round_rect_rects()
308 REPORTER_ASSERT(reporter, rect == r); in test_round_rect_rects()
315 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr3.type()); in test_round_rect_rects()
319 static void test_round_rect_ovals(skiatest::Reporter* reporter) { in test_round_rect_ovals() argument
326 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type()); in test_round_rect_ovals()
328 REPORTER_ASSERT(reporter, oval == rect); in test_round_rect_ovals()
332 static void test_round_rect_general(skiatest::Reporter* reporter) { in test_round_rect_general() argument
338 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type()); in test_round_rect_general()
346 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type()); in test_round_rect_general()
350 static void test_round_rect_iffy_parameters(skiatest::Reporter* reporter) { in test_round_rect_iffy_parameters() argument
360 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr1.type()); in test_round_rect_iffy_parameters()
364 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fX, 33.33333f)); in test_round_rect_iffy_parameters()
365 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fY, 66.66666f)); in test_round_rect_iffy_parameters()
371 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type()); in test_round_rect_iffy_parameters()
375 REPORTER_ASSERT(reporter, 0.0f == p2.fX); in test_round_rect_iffy_parameters()
376 REPORTER_ASSERT(reporter, 0.0f == p2.fY); in test_round_rect_iffy_parameters()
381 static void test_direction(skiatest::Reporter* reporter, const SkRRect &rr, in test_direction() argument
391 REPORTER_ASSERT(reporter, contains[i] == rr.contains(test)); in test_direction()
399 static void test_round_rect_contains_rect(skiatest::Reporter* reporter) { in test_round_rect_contains_rect() argument
429 REPORTER_ASSERT(reporter, !rrects[i].contains(easyOuts[j])); in test_round_rect_contains_rect()
502 test_direction(reporter, rrects[i], 0, 1, 0, 1, kNumSteps, answers[i][0]); // NW in test_round_rect_contains_rect()
503 test_direction(reporter, rrects[i], 19.5f, 0, 0, 1, kNumSteps, answers[i][1]); // N in test_round_rect_contains_rect()
504 test_direction(reporter, rrects[i], 40, -1, 0, 1, kNumSteps, answers[i][2]); // NE in test_round_rect_contains_rect()
505 test_direction(reporter, rrects[i], 40, -1, 19.5f, 0, kNumSteps, answers[i][3]); // E in test_round_rect_contains_rect()
506 test_direction(reporter, rrects[i], 40, -1, 40, -1, kNumSteps, answers[i][4]); // SE in test_round_rect_contains_rect()
507 test_direction(reporter, rrects[i], 19.5f, 0, 40, -1, kNumSteps, answers[i][5]); // S in test_round_rect_contains_rect()
508 test_direction(reporter, rrects[i], 0, 1, 40, -1, kNumSteps, answers[i][6]); // SW in test_round_rect_contains_rect()
509 test_direction(reporter, rrects[i], 0, 1, 19.5f, 0, kNumSteps, answers[i][7]); // W in test_round_rect_contains_rect()
514 static void assert_transform_failure(skiatest::Reporter* reporter, const SkRRect& orig, in assert_transform_failure() argument
525 REPORTER_ASSERT(reporter, !success); in assert_transform_failure()
527 REPORTER_ASSERT(reporter, copyOfDst == dst); in assert_transform_failure()
529 REPORTER_ASSERT(reporter, copyOfOrig == orig); in assert_transform_failure()
530 REPORTER_ASSERT(reporter, orig != dst); in assert_transform_failure()
544 static void test_transform_helper(skiatest::Reporter* reporter, const SkRRect& orig) { in test_transform_helper() argument
550 REPORTER_ASSERT(reporter, success); in test_transform_helper()
551 REPORTER_ASSERT(reporter, orig == dst); in test_transform_helper()
557 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
561 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
565 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
569 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
574 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
576 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
586 REPORTER_ASSERT(reporter, success); in test_transform_helper()
588 REPORTER_ASSERT(reporter, in test_transform_helper()
591 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
592 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
593 REPORTER_ASSERT(reporter, dst.rect().left() == orig.rect().left() + translateX); in test_transform_helper()
594 REPORTER_ASSERT(reporter, dst.rect().top() == orig.rect().top() + translateY); in test_transform_helper()
598 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
605 REPORTER_ASSERT(reporter, success); in test_transform_helper()
609 REPORTER_ASSERT(reporter, origUL == dstUR); in test_transform_helper()
610 REPORTER_ASSERT(reporter, origUR == dstUL); in test_transform_helper()
611 REPORTER_ASSERT(reporter, origLR == dstLL); in test_transform_helper()
612 REPORTER_ASSERT(reporter, origLL == dstLR); in test_transform_helper()
615 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
616 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
618 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left()); in test_transform_helper()
620 REPORTER_ASSERT(reporter, orig.rect().top() == dst.rect().top()); in test_transform_helper()
624 assert_transform_failure(reporter, orig, matrix); in test_transform_helper()
631 REPORTER_ASSERT(reporter, success); in test_transform_helper()
635 REPORTER_ASSERT(reporter, origUL == dstLL); in test_transform_helper()
636 REPORTER_ASSERT(reporter, origUR == dstLR); in test_transform_helper()
637 REPORTER_ASSERT(reporter, origLR == dstUR); in test_transform_helper()
638 REPORTER_ASSERT(reporter, origLL == dstUL); in test_transform_helper()
641 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
642 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
644 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom()); in test_transform_helper()
646 REPORTER_ASSERT(reporter, orig.rect().left() == dst.rect().left()); in test_transform_helper()
654 REPORTER_ASSERT(reporter, success); in test_transform_helper()
657 REPORTER_ASSERT(reporter, origUL == dstLR); in test_transform_helper()
658 REPORTER_ASSERT(reporter, origUR == dstLL); in test_transform_helper()
659 REPORTER_ASSERT(reporter, origLR == dstUL); in test_transform_helper()
660 REPORTER_ASSERT(reporter, origLL == dstUR); in test_transform_helper()
663 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width()); in test_transform_helper()
664 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height()); in test_transform_helper()
665 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom()); in test_transform_helper()
666 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left()); in test_transform_helper()
676 REPORTER_ASSERT(reporter, success); in test_transform_helper()
679 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fX, in test_transform_helper()
681 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fY, in test_transform_helper()
684 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().width(), in test_transform_helper()
686 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().height(), in test_transform_helper()
688 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().left(), in test_transform_helper()
690 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().top(), in test_transform_helper()
694 static void test_round_rect_transform(skiatest::Reporter* reporter) { in test_round_rect_transform() argument
699 test_transform_helper(reporter, rrect); in test_round_rect_transform()
709 test_transform_helper(reporter, rrect); in test_round_rect_transform()
717 static void test_issue_2696(skiatest::Reporter* reporter) { in test_issue_2696() argument
729 REPORTER_ASSERT(reporter, success); in test_issue_2696()
735 REPORTER_ASSERT(reporter, in test_issue_2696()
737 REPORTER_ASSERT(reporter, in test_issue_2696()
742 void test_read_rrect(skiatest::Reporter* reporter, const SkRRect& rrect, bool shouldEqualSrc) { in test_read_rrect() argument
749 REPORTER_ASSERT(reporter, size == SkRRect::kSizeInMemory); in test_read_rrect()
750 REPORTER_ASSERT(reporter, deserialized.isValid()); in test_read_rrect()
752 REPORTER_ASSERT(reporter, rrect == deserialized); in test_read_rrect()
756 static void test_read(skiatest::Reporter* reporter) { in test_read() argument
762 test_read_rrect(reporter, SkRRect::MakeEmpty(), true); in test_read()
763 test_read_rrect(reporter, SkRRect::MakeRect(kRect), true); in test_read()
765 test_read_rrect(reporter, SkRRect::MakeRect(kInfRect), true); in test_read()
766 test_read_rrect(reporter, SkRRect::MakeRect(kNaNRect), true); in test_read()
772 test_read_rrect(reporter, rrect, false); in test_read()
774 test_read_rrect(reporter, rrect, false); in test_read()
776 test_read_rrect(reporter, SkRRect::MakeOval(kRect), true); in test_read()
777 test_read_rrect(reporter, SkRRect::MakeOval(kInfRect), true); in test_read()
778 test_read_rrect(reporter, SkRRect::MakeOval(kNaNRect), true); in test_read()
781 test_read_rrect(reporter, rrect, false); in test_read()
783 test_read_rrect(reporter, rrect, false); in test_read()
785 test_read_rrect(reporter, SkRRect::MakeRectXY(kRect, 5.f, 5.f), true); in test_read()
787 test_read_rrect(reporter, SkRRect::MakeRectXY(kRect, 5.f, 400.f), true); in test_read()
791 test_read_rrect(reporter, rrect, true); in test_read()
795 test_read_rrect(reporter, rrect, false); in test_read()
797 test_read_rrect(reporter, rrect, false); in test_read()
799 test_read_rrect(reporter, rrect, false); in test_read()
801 test_read_rrect(reporter, rrect, false); in test_read()
804 DEF_TEST(RoundRect, reporter) { in DEF_TEST() argument
805 test_round_rect_basic(reporter); in DEF_TEST()
806 test_round_rect_rects(reporter); in DEF_TEST()
807 test_round_rect_ovals(reporter); in DEF_TEST()
808 test_round_rect_general(reporter); in DEF_TEST()
809 test_round_rect_iffy_parameters(reporter); in DEF_TEST()
810 test_inset(reporter); in DEF_TEST()
811 test_round_rect_contains_rect(reporter); in DEF_TEST()
812 test_round_rect_transform(reporter); in DEF_TEST()
813 test_issue_2696(reporter); in DEF_TEST()
814 test_tricky_radii(reporter); in DEF_TEST()
815 test_empty_crbug_458524(reporter); in DEF_TEST()
816 test_empty(reporter); in DEF_TEST()
817 test_read(reporter); in DEF_TEST()