Lines Matching refs:Reporter
30 template <typename T> void assert16(skiatest::Reporter* reporter, const T data[],
35 REPORTER_ASSERT(reporter, data[0] == m0);
36 REPORTER_ASSERT(reporter, data[1] == m1);
37 REPORTER_ASSERT(reporter, data[2] == m2);
38 REPORTER_ASSERT(reporter, data[3] == m3);
40 REPORTER_ASSERT(reporter, data[4] == m4);
41 REPORTER_ASSERT(reporter, data[5] == m5);
42 REPORTER_ASSERT(reporter, data[6] == m6);
43 REPORTER_ASSERT(reporter, data[7] == m7);
45 REPORTER_ASSERT(reporter, data[8] == m8);
46 REPORTER_ASSERT(reporter, data[9] == m9);
47 REPORTER_ASSERT(reporter, data[10] == m10);
48 REPORTER_ASSERT(reporter, data[11] == m11);
50 REPORTER_ASSERT(reporter, data[12] == m12);
51 REPORTER_ASSERT(reporter, data[13] == m13);
52 REPORTER_ASSERT(reporter, data[14] == m14);
53 REPORTER_ASSERT(reporter, data[15] == m15);
78 static void test_constructor(skiatest::Reporter* reporter) {
93 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix);
94 REPORTER_ASSERT(reporter, !testMatrix->isIdentity());
97 REPORTER_ASSERT(reporter, nearly_equal_double(row * col, testMatrix->getDouble(row, col)));
104 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix);
105 REPORTER_ASSERT(reporter, testMatrix->isIdentity());
106 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
111 REPORTER_ASSERT(reporter, scaleMatrix.isScale());
113 REPORTER_ASSERT(reporter, testMatrix->isIdentity());
114 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
117 static void test_translate(skiatest::Reporter* reporter) {
122 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
124 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kTranslate_Mask));
125 REPORTER_ASSERT(reporter, mat.invert(&inverse));
126 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kTranslate_Mask));
137 REPORTER_ASSERT(reporter, mat == c);
142 REPORTER_ASSERT(reporter, mat == c);
145 static void test_scale(skiatest::Reporter* reporter) {
150 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
152 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kScale_Mask));
153 REPORTER_ASSERT(reporter, mat.invert(&inverse));
154 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kScale_Mask));
165 REPORTER_ASSERT(reporter, mat == c);
170 REPORTER_ASSERT(reporter, mat == c);
197 static void test_map2(skiatest::Reporter* reporter, const SkMatrix44& mat) {
211 REPORTER_ASSERT(reporter, dstA[i] == dstB[i]);
215 static void test_map2(skiatest::Reporter* reporter) {
220 test_map2(reporter, mat);
224 static void test_gettype(skiatest::Reporter* reporter) {
227 REPORTER_ASSERT(reporter, matrix.isIdentity());
228 REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType());
234 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
238 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
242 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
245 REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask);
252 REPORTER_ASSERT(reporter, matrix.isIdentity());
254 REPORTER_ASSERT(reporter, matrix.isIdentity());
256 REPORTER_ASSERT(reporter, matrix.isIdentity());
259 static void test_common_angles(skiatest::Reporter* reporter) {
267 REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
271 static void test_concat(skiatest::Reporter* reporter) {
291 REPORTER_ASSERT(reporter, d == c);
295 REPORTER_ASSERT(reporter, 10 == dst[i]);
296 REPORTER_ASSERT(reporter, 12 == dst[i + 4]);
303 REPORTER_ASSERT(reporter, d == c);
307 REPORTER_ASSERT(reporter, 20 == dst[i]);
308 REPORTER_ASSERT(reporter, 22 == dst[i + 4]);
312 static void test_determinant(skiatest::Reporter* reporter) {
314 REPORTER_ASSERT(reporter, nearly_equal_double(1, a.determinant()));
316 REPORTER_ASSERT(reporter, nearly_equal_double(2, a.determinant()));
318 REPORTER_ASSERT(reporter, a.invert(&b));
319 REPORTER_ASSERT(reporter, nearly_equal_double(0.5, b.determinant()));
323 REPORTER_ASSERT(reporter,
328 REPORTER_ASSERT(reporter, nearly_equal_double(16, d.determinant()));
332 REPORTER_ASSERT(reporter, nearly_equal_double(32, e.determinant()));
334 REPORTER_ASSERT(reporter, nearly_equal_double(0, e.determinant()));
337 static void test_invert(skiatest::Reporter* reporter) {
344 assert16<double>(reporter, inverseData,
354 assert16<double>(reporter, inverseData,
364 assert16<double>(reporter, inverseData,
375 assert16<double>(reporter, inverseData,
391 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
404 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
415 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
428 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
432 REPORTER_ASSERT(reporter, tinyScale.getType() == SkMatrix44::kScale_Mask);
433 REPORTER_ASSERT(reporter, !tinyScale.invert(nullptr));
434 REPORTER_ASSERT(reporter, !tinyScale.invert(&inverse));
438 REPORTER_ASSERT(reporter, tinyScaleTranslate.invert(nullptr));
441 reporter, tinyScaleTranslate.getType() ==
443 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(nullptr));
444 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(&inverse));
449 REPORTER_ASSERT(reporter, (tinyScalePerspective.getType() &
452 REPORTER_ASSERT(reporter
453 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(&inverse));
456 static void test_transpose(skiatest::Reporter* reporter) {
469 REPORTER_ASSERT(reporter, nearly_equal(a, b));
472 static void test_get_set_double(skiatest::Reporter* reporter) {
477 REPORTER_ASSERT(reporter,
481 REPORTER_ASSERT(reporter,
487 static void test_set_3x3(skiatest::Reporter* r) {
504 static void test_set_row_col_major(skiatest::Reporter* reporter) {
518 REPORTER_ASSERT(reporter, nearly_equal(a, b));
521 REPORTER_ASSERT(reporter, nearly_equal(a, b));
524 REPORTER_ASSERT(reporter, nearly_equal(a, b));
527 REPORTER_ASSERT(reporter, nearly_equal(a, b));
530 static void test_3x3_conversion(skiatest::Reporter* reporter) {
548 REPORTER_ASSERT(reporter, expected33 == a33);
553 REPORTER_ASSERT(reporter, nearly_equal(a44flattened, expected44flattened));
565 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec3transformed[0]));
566 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec3transformed[1]));
567 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec3transformed[2]));
568 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec4transformed2[0]));
569 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec4transformed2[1]));
570 REPORTER_ASSERT(reporter, !nearly_equal_scalar(vec4transformed[2], vec4transformed2[2]));
571 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3]));
574 static void test_has_perspective(skiatest::Reporter* reporter) {
578 REPORTER_ASSERT(reporter, transform.hasPerspective());
581 REPORTER_ASSERT(reporter, !transform.hasPerspective());
584 REPORTER_ASSERT(reporter, transform.hasPerspective());
588 REPORTER_ASSERT(reporter, transform.hasPerspective());
592 REPORTER_ASSERT(reporter, transform.hasPerspective());
596 REPORTER_ASSERT(reporter, transform.hasPerspective());
600 REPORTER_ASSERT(reporter, transform.hasPerspective());
626 static bool empirically_preserves_2d_axis_alignment(skiatest::Reporter* reporter,
633 REPORTER_ASSERT(reporter, is_rectilinear(p1, p2, p3, p4));
643 static void test(bool expected, skiatest::Reporter* reporter, const SkMatrix44& transform) {
645 REPORTER_ASSERT(reporter, empirically_preserves_2d_axis_alignment(reporter, transform));
646 REPORTER_ASSERT(reporter, transform.preserves2dAxisAlignment());
648 REPORTER_ASSERT(reporter, !empirically_preserves_2d_axis_alignment(reporter, transform));
649 REPORTER_ASSERT(reporter, !transform.preserves2dAxisAlignment());
653 static void test_preserves_2d_axis_alignment(skiatest::Reporter* reporter) {
704 test(value.expected, reporter, transform);
726 test(value.expected, reporter, transform);
752 test(false, reporter, transform);
773 test(value.expected, reporter, transform);
797 test(value.expected, reporter, transform);
805 test(false, reporter, transform);
811 test(true, reporter, transform);
815 static void test_toint(skiatest::Reporter* reporter) {
825 REPORTER_ASSERT(reporter, sum >= 0);
826 REPORTER_ASSERT(reporter, isum >= 0);
827 REPORTER_ASSERT(reporter, static_cast<SkMScalar>(isum) == SkIntToMScalar(isum));
830 DEF_TEST(Matrix44, reporter) {
840 REPORTER_ASSERT(reporter, is_identity(iden1));
845 REPORTER_ASSERT(reporter, is_identity(iden1));
850 REPORTER_ASSERT(reporter, is_identity(iden1));
855 REPORTER_ASSERT(reporter, mat.invert(nullptr));
858 REPORTER_ASSERT(reporter, is_identity(iden1));
860 REPORTER_ASSERT(reporter, is_identity(iden2));
869 REPORTER_ASSERT(reporter, mat.invert(nullptr));
872 REPORTER_ASSERT(reporter, is_identity(iden1));
884 REPORTER_ASSERT(reporter, mat.invert(nullptr));
887 REPORTER_ASSERT(reporter, is_identity(iden1));
892 REPORTER_ASSERT(reporter, !mat.invert(nullptr));
901 assert16<float>(reporter, dataf,
907 assert16<double>(reporter, datad, 1, 0, 0, 0,
912 assert16<float>(reporter, dataf, 1, 0, 0, 2,
917 assert16<double>(reporter, datad, 1, 0, 0, 2,
923 test_concat(reporter);
926 test_common_angles(reporter);
929 test_constructor(reporter);
930 test_gettype(reporter);
931 test_determinant(reporter);
932 test_invert(reporter);
933 test_transpose(reporter);
934 test_get_set_double(reporter);
935 test_set_row_col_major(reporter);
936 test_set_3x3(reporter);
937 test_translate(reporter);
938 test_scale(reporter);
939 test_map2(reporter);
940 test_3x3_conversion(reporter);
941 test_has_perspective(reporter);
942 test_preserves_2d_axis_alignment(reporter);
943 test_toint(reporter);