| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkMath.h" | 8 #include "SkMath.h" |
| 9 #include "SkMatrix.h" | 9 #include "SkMatrix.h" |
| 10 #include "SkMatrixUtils.h" | 10 #include "SkMatrixUtils.h" |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 return scalar_array_nearly_equal_relative(res, dst, 3); | 657 return scalar_array_nearly_equal_relative(res, dst, 3); |
| 658 } | 658 } |
| 659 | 659 |
| 660 static void test_matrix_homogeneous(skiatest::Reporter* reporter) { | 660 static void test_matrix_homogeneous(skiatest::Reporter* reporter) { |
| 661 SkMatrix mat; | 661 SkMatrix mat; |
| 662 | 662 |
| 663 const float kRotation0 = 15.5f; | 663 const float kRotation0 = 15.5f; |
| 664 const float kRotation1 = -50.f; | 664 const float kRotation1 = -50.f; |
| 665 const float kScale0 = 5000.f; | 665 const float kScale0 = 5000.f; |
| 666 | 666 |
| 667 #if defined(GOOGLE3) |
| 668 // Stack frame size is limited in GOOGLE3. |
| 669 const int kTripleCount = 100; |
| 670 const int kMatrixCount = 100; |
| 671 #else |
| 667 const int kTripleCount = 1000; | 672 const int kTripleCount = 1000; |
| 668 const int kMatrixCount = 1000; | 673 const int kMatrixCount = 1000; |
| 674 #endif |
| 669 SkRandom rand; | 675 SkRandom rand; |
| 670 | 676 |
| 671 SkScalar randTriples[3*kTripleCount]; | 677 SkScalar randTriples[3*kTripleCount]; |
| 672 for (int i = 0; i < 3*kTripleCount; ++i) { | 678 for (int i = 0; i < 3*kTripleCount; ++i) { |
| 673 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f); | 679 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f); |
| 674 } | 680 } |
| 675 | 681 |
| 676 SkMatrix mats[kMatrixCount]; | 682 SkMatrix mats[kMatrixCount]; |
| 677 for (int i = 0; i < kMatrixCount; ++i) { | 683 for (int i = 0; i < kMatrixCount; ++i) { |
| 678 for (int j = 0; j < 9; ++j) { | 684 for (int j = 0; j < 9; ++j) { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 a.setTranslate(10, 20); | 939 a.setTranslate(10, 20); |
| 934 | 940 |
| 935 SkMatrix b; | 941 SkMatrix b; |
| 936 b.setScale(3, 5); | 942 b.setScale(3, 5); |
| 937 | 943 |
| 938 SkMatrix expected; | 944 SkMatrix expected; |
| 939 expected.setConcat(a,b); | 945 expected.setConcat(a,b); |
| 940 | 946 |
| 941 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); | 947 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); |
| 942 } | 948 } |
| OLD | NEW |