OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkMath.h" | 9 #include "SkMath.h" |
10 #include "SkMatrix.h" | 10 #include "SkMatrix.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 | 567 |
568 static void test_matrix_homogeneous(skiatest::Reporter* reporter) { | 568 static void test_matrix_homogeneous(skiatest::Reporter* reporter) { |
569 SkMatrix mat; | 569 SkMatrix mat; |
570 | 570 |
571 const float kRotation0 = 15.5f; | 571 const float kRotation0 = 15.5f; |
572 const float kRotation1 = -50.f; | 572 const float kRotation1 = -50.f; |
573 const float kScale0 = 5000.f; | 573 const float kScale0 = 5000.f; |
574 | 574 |
575 const int kTripleCount = 1000; | 575 const int kTripleCount = 1000; |
576 const int kMatrixCount = 1000; | 576 const int kMatrixCount = 1000; |
577 SkRandom rand; | 577 SkMWCRandom rand; |
578 | 578 |
579 SkScalar randTriples[3*kTripleCount]; | 579 SkScalar randTriples[3*kTripleCount]; |
580 for (int i = 0; i < 3*kTripleCount; ++i) { | 580 for (int i = 0; i < 3*kTripleCount; ++i) { |
581 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f); | 581 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f); |
582 } | 582 } |
583 | 583 |
584 SkMatrix mats[kMatrixCount]; | 584 SkMatrix mats[kMatrixCount]; |
585 for (int i = 0; i < kMatrixCount; ++i) { | 585 for (int i = 0; i < kMatrixCount; ++i) { |
586 for (int j = 0; j < 9; ++j) { | 586 for (int j = 0; j < 9; ++j) { |
587 mats[i].set(j, rand.nextRangeF(-3000.f, 3000.f)); | 587 mats[i].set(j, rand.nextRangeF(-3000.f, 3000.f)); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 798 |
799 test_matrix_max_stretch(reporter); | 799 test_matrix_max_stretch(reporter); |
800 test_matrix_is_similarity(reporter); | 800 test_matrix_is_similarity(reporter); |
801 test_matrix_recttorect(reporter); | 801 test_matrix_recttorect(reporter); |
802 test_matrix_decomposition(reporter); | 802 test_matrix_decomposition(reporter); |
803 test_matrix_homogeneous(reporter); | 803 test_matrix_homogeneous(reporter); |
804 } | 804 } |
805 | 805 |
806 #include "TestClassDef.h" | 806 #include "TestClassDef.h" |
807 DEFINE_TESTCLASS("Matrix", MatrixTestClass, TestMatrix) | 807 DEFINE_TESTCLASS("Matrix", MatrixTestClass, TestMatrix) |
OLD | NEW |