Lines Matching full:reporter
15 static void test_inset(skiatest::Reporter* reporter) {
21 REPORTER_ASSERT(reporter, rr2.isRect());
24 REPORTER_ASSERT(reporter, rr2.isRect());
27 REPORTER_ASSERT(reporter, rr2.isEmpty());
31 REPORTER_ASSERT(reporter, rr2.isSimple());
33 REPORTER_ASSERT(reporter, rr2.isRect());
37 static void test_round_rect_basic(skiatest::Reporter* reporter) {
44 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
45 REPORTER_ASSERT(reporter, empty.rect().isEmpty());
48 REPORTER_ASSERT(reporter, zeroPt == empty.radii((SkRRect::Corner) i));
57 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
58 REPORTER_ASSERT(reporter, rr1.rect() == rect);
61 REPORTER_ASSERT(reporter, zeroPt == rr1.radii((SkRRect::Corner) i));
66 REPORTER_ASSERT(reporter, rr1_2 == rr1 && rr1_2.getType() == rr1.getType());
69 REPORTER_ASSERT(reporter, rr1_3 == rr1 && rr1_3.getType() == rr1.getType());
76 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr2.type());
77 REPORTER_ASSERT(reporter, rr2.rect() == rect);
80 REPORTER_ASSERT(reporter,
87 REPORTER_ASSERT(reporter, rr2_2 == rr2 && rr2_2.getType() == rr2.getType());
90 REPORTER_ASSERT(reporter, rr2_3 == rr2 && rr2_3.getType() == rr2.getType());
97 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr3.type());
98 REPORTER_ASSERT(reporter, rr3.rect() == rect);
101 REPORTER_ASSERT(reporter, p == rr3.radii((SkRRect::Corner) i));
106 REPORTER_ASSERT(reporter, rr3_2 == rr3 && rr3_2.getType() == rr3.getType());
109 REPORTER_ASSERT(reporter, rr3_3 == rr3 && rr3_3.getType() == rr3.getType());
118 REPORTER_ASSERT(reporter, SkRRect::kNinePatch_Type == rr4.type());
119 REPORTER_ASSERT(reporter, rr4.rect() == rect);
124 REPORTER_ASSERT(reporter, rquad[i] == rr4.radii((SkRRect::Corner) i));
129 REPORTER_ASSERT(reporter, rr4_2 == rr4 && rr4_2.getType() == rr4.getType());
137 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr5.type());
138 REPORTER_ASSERT(reporter, rr5.rect() == rect);
141 REPORTER_ASSERT(reporter, radii2[i] == rr5.radii((SkRRect::Corner) i));
145 REPORTER_ASSERT(reporter, empty != rr3);
146 REPORTER_ASSERT(reporter, rr3 != rr4);
147 REPORTER_ASSERT(reporter, rr4 != rr5);
151 static void test_round_rect_rects(skiatest::Reporter* reporter) {
159 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
161 REPORTER_ASSERT(reporter, 0 == r.fLeft && 0 == r.fTop && 0 == r.fRight && 0 == r.fBottom);
168 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
170 REPORTER_ASSERT(reporter, rect == r);
178 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
180 REPORTER_ASSERT(reporter, rect == r);
187 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr3.type());
191 static void test_round_rect_ovals(skiatest::Reporter* reporter) {
198 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
200 REPORTER_ASSERT(reporter, oval == rect);
204 static void test_round_rect_general(skiatest::Reporter* reporter) {
210 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
218 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
222 static void test_round_rect_iffy_parameters(skiatest::Reporter* reporter) {
232 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr1.type());
236 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fX, 33.33333f));
237 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fY, 66.66666f));
243 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
247 REPORTER_ASSERT(reporter, 0.0f == p2.fX);
248 REPORTER_ASSERT(reporter, 0.0f == p2.fY);
253 static void test_direction(skiatest::Reporter* reporter, const SkRRect &rr,
263 REPORTER_ASSERT(reporter, contains[i] == rr.contains(test));
271 static void test_round_rect_contains_rect(skiatest::Reporter* reporter) {
301 REPORTER_ASSERT(reporter, !rrects[i].contains(easyOuts[j]));
374 test_direction(reporter, rrects[i], 0, 1, 0, 1, kNumSteps, answers[i][0]); // NW
375 test_direction(reporter, rrects[i], 19.5f, 0, 0, 1, kNumSteps, answers[i][1]); // N
376 test_direction(reporter, rrects[i], 40, -1, 0, 1, kNumSteps, answers[i][2]); // NE
377 test_direction(reporter, rrects[i], 40, -1, 19.5f, 0, kNumSteps, answers[i][3]); // E
378 test_direction(reporter, rrects[i], 40, -1, 40, -1, kNumSteps, answers[i][4]); // SE
379 test_direction(reporter, rrects[i], 19.5f, 0, 40, -1, kNumSteps, answers[i][5]); // S
380 test_direction(reporter, rrects[i], 0, 1, 40, -1, kNumSteps, answers[i][6]); // SW
381 test_direction(reporter, rrects[i], 0, 1, 19.5f, 0, kNumSteps, answers[i][7]); // W
386 static void assert_transform_failure(skiatest::Reporter* reporter, const SkRRect& orig,
397 REPORTER_ASSERT(reporter, !success);
399 REPORTER_ASSERT(reporter, copyOfDst == dst);
401 REPORTER_ASSERT(reporter, copyOfOrig == orig);
402 REPORTER_ASSERT(reporter, orig != dst);
416 static void test_transform_helper(skiatest::Reporter* reporter, const SkRRect& orig) {
422 REPORTER_ASSERT(reporter, success);
423 REPORTER_ASSERT(reporter, orig == dst);
429 assert_transform_failure(reporter, orig, matrix);
433 assert_transform_failure(reporter, orig, matrix);
437 assert_transform_failure(reporter, orig, matrix);
441 assert_transform_failure(reporter, orig, matrix);
446 assert_transform_failure(reporter, orig, matrix);
448 assert_transform_failure(reporter, orig, matrix);
458 REPORTER_ASSERT(reporter, success);
460 REPORTER_ASSERT(reporter,
463 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
464 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
465 REPORTER_ASSERT(reporter, dst.rect().left() == orig.rect().left() + translateX);
466 REPORTER_ASSERT(reporter, dst.rect().top() == orig.rect().top() + translateY);
470 assert_transform_failure(reporter, orig, matrix);
477 REPORTER_ASSERT(reporter, success);
481 REPORTER_ASSERT(reporter, origUL == dstUR);
482 REPORTER_ASSERT(reporter, origUR == dstUL);
483 REPORTER_ASSERT(reporter, origLR == dstLL);
484 REPORTER_ASSERT(reporter, origLL == dstLR);
487 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
488 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
490 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
492 REPORTER_ASSERT(reporter, orig.rect().top() == dst.rect().top());
496 assert_transform_failure(reporter, orig, matrix);
503 REPORTER_ASSERT(reporter, success);
507 REPORTER_ASSERT(reporter, origUL == dstLL);
508 REPORTER_ASSERT(reporter, origUR == dstLR);
509 REPORTER_ASSERT(reporter, origLR == dstUR);
510 REPORTER_ASSERT(reporter, origLL == dstUL);
513 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
514 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
516 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
518 REPORTER_ASSERT(reporter, orig.rect().left() == dst.rect().left());
526 REPORTER_ASSERT(reporter, success);
529 REPORTER_ASSERT(reporter, origUL == dstLR);
530 REPORTER_ASSERT(reporter, origUR == dstLL);
531 REPORTER_ASSERT(reporter, origLR == dstUL);
532 REPORTER_ASSERT(reporter, origLL == dstUR);
535 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
536 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
537 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
538 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
548 REPORTER_ASSERT(reporter, success);
551 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fX,
553 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fY,
556 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().width(),
558 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().height(),
560 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().left(),
562 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().top(),
566 static void test_round_rect_transform(skiatest::Reporter* reporter) {
571 test_transform_helper(reporter, rrect);
581 test_transform_helper(reporter, rrect);
585 DEF_TEST(RoundRect, reporter) {
586 test_round_rect_basic(reporter);
587 test_round_rect_rects(reporter);
588 test_round_rect_ovals(reporter);
589 test_round_rect_general(reporter);
590 test_round_rect_iffy_parameters(reporter);
591 test_inset(reporter);
592 test_round_rect_contains_rect(reporter);
593 test_round_rect_transform(reporter);