Lines Matching refs:SkMatrix
19 static bool nearly_equal(const SkMatrix& a, const SkMatrix& b) { in nearly_equal()
30 const SkMatrix& a, in are_equal()
31 const SkMatrix& b) { in are_equal()
68 static bool is_identity(const SkMatrix& m) { in is_identity()
69 SkMatrix identity; in is_identity()
76 SkMatrix matrix; in test_matrix_recttorect()
80 matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit); in test_matrix_recttorect()
81 REPORTER_ASSERT(reporter, SkMatrix::kIdentity_Mask == matrix.getType()); in test_matrix_recttorect()
85 matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit); in test_matrix_recttorect()
86 REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask == matrix.getType()); in test_matrix_recttorect()
90 matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit); in test_matrix_recttorect()
92 (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask) == matrix.getType()); in test_matrix_recttorect()
97 matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit); in test_matrix_recttorect()
98 REPORTER_ASSERT(reporter, SkMatrix::kScale_Mask == matrix.getType()); in test_matrix_recttorect()
102 static void test_flatten(skiatest::Reporter* reporter, const SkMatrix& m) { in test_flatten()
104 static const size_t kBufferSize = SkMatrix::kMaxFlattenSize + 100; in test_flatten()
109 REPORTER_ASSERT(reporter, size1 <= SkMatrix::kMaxFlattenSize); in test_flatten()
111 SkMatrix m2; in test_flatten()
126 SkMatrix identity; in test_matrix_min_max_scale()
133 SkMatrix scale; in test_matrix_min_max_scale()
140 SkMatrix rot90Scale; in test_matrix_min_max_scale()
148 SkMatrix rotate; in test_matrix_min_max_scale()
157 SkMatrix translate; in test_matrix_min_max_scale()
164 SkMatrix perspX; in test_matrix_min_max_scale()
175 SkMatrix perspY; in test_matrix_min_max_scale()
185 SkMatrix baseMats[] = {scale, rot90Scale, rotate, in test_matrix_min_max_scale()
187 SkMatrix mats[2*SK_ARRAY_COUNT(baseMats)]; in test_matrix_min_max_scale()
195 SkMatrix mat; in test_matrix_min_max_scale()
249 SkMatrix mat; in test_matrix_is_similarity()
368 0, 0, SkMatrix::I()[8]); in test_matrix_is_similarity()
394 static bool check_matrix_recomposition(const SkMatrix& mat, in check_matrix_recomposition()
406 bool result = scalar_nearly_equal_relative(mat[SkMatrix::kMScaleX], in check_matrix_recomposition()
408 scalar_nearly_equal_relative(mat[SkMatrix::kMSkewX], in check_matrix_recomposition()
410 scalar_nearly_equal_relative(mat[SkMatrix::kMSkewY], in check_matrix_recomposition()
412 scalar_nearly_equal_relative(mat[SkMatrix::kMScaleY], in check_matrix_recomposition()
418 SkMatrix mat; in test_matrix_decomposition()
532 SkScalar perpdot = mat[SkMatrix::kMScaleX]*mat[SkMatrix::kMScaleY] - in test_matrix_decomposition()
533 mat[SkMatrix::kMSkewX]*mat[SkMatrix::kMSkewY]; in test_matrix_decomposition()
544 mat[SkMatrix::kMPersp0] = 12.f; in test_matrix_decomposition()
545 mat[SkMatrix::kMPersp1] = 4.f; in test_matrix_decomposition()
546 mat[SkMatrix::kMPersp2] = 1872.f; in test_matrix_decomposition()
553 mat[SkMatrix::kMScaleX] = 0.f; in test_matrix_decomposition()
556 mat[SkMatrix::kMScaleY] = 0.f; in test_matrix_decomposition()
560 mat[SkMatrix::kMScaleX] = 1.f; in test_matrix_decomposition()
561 mat[SkMatrix::kMSkewX] = 2.f; in test_matrix_decomposition()
562 mat[SkMatrix::kMSkewY] = 4.f; in test_matrix_decomposition()
563 mat[SkMatrix::kMScaleY] = 8.f; in test_matrix_decomposition()
579 static bool naive_homogeneous_mapping(const SkMatrix& m, const SkScalar src[3], in naive_homogeneous_mapping()
592 SkMatrix mat; in test_matrix_homogeneous()
607 SkMatrix mats[kMatrixCount]; in test_matrix_homogeneous()
706 SkMatrix mat, inverse, iden1, iden2; in DEF_TEST()
770 SkMatrix m; in DEF_TEST()
773 m.set(SkMatrix::kMScaleX, gRectStaysRectSamples[i].m00); in DEF_TEST()
774 m.set(SkMatrix::kMSkewX, gRectStaysRectSamples[i].m01); in DEF_TEST()
775 m.set(SkMatrix::kMSkewY, gRectStaysRectSamples[i].m10); in DEF_TEST()
776 m.set(SkMatrix::kMScaleY, gRectStaysRectSamples[i].m11); in DEF_TEST()
783 mat.set(SkMatrix::kMScaleX, SkIntToScalar(1)); in DEF_TEST()
784 mat.set(SkMatrix::kMSkewX, SkIntToScalar(2)); in DEF_TEST()
785 mat.set(SkMatrix::kMTransX, SkIntToScalar(3)); in DEF_TEST()
786 mat.set(SkMatrix::kMSkewY, SkIntToScalar(4)); in DEF_TEST()
787 mat.set(SkMatrix::kMScaleY, SkIntToScalar(5)); in DEF_TEST()
788 mat.set(SkMatrix::kMTransY, SkIntToScalar(6)); in DEF_TEST()
792 #define affineEqual(e) affine[SkMatrix::kA##e] == mat.get(SkMatrix::kM##e) in DEF_TEST()
801 mat.set(SkMatrix::kMPersp1, SkScalarToPersp(SK_Scalar1 / 2)); in DEF_TEST()
804 SkMatrix mat2; in DEF_TEST()
808 mat.set(SkMatrix::kMSkewX, -zero); in DEF_TEST()
813 mat.set(SkMatrix::kMSkewX, SK_ScalarNaN); in DEF_TEST()
814 mat2.set(SkMatrix::kMSkewX, SK_ScalarNaN); in DEF_TEST()
825 SkMatrix a; in DEF_TEST()
828 SkMatrix b; in DEF_TEST()
831 SkMatrix expected; in DEF_TEST()
834 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); in DEF_TEST()