| 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 24 matching lines...) Expand all Loading... |
| 35 if (equal) { | 35 if (equal) { |
| 36 bool foundZeroSignDiff = false; | 36 bool foundZeroSignDiff = false; |
| 37 for (int i = 0; i < 9; ++i) { | 37 for (int i = 0; i < 9; ++i) { |
| 38 float aVal = a.get(i); | 38 float aVal = a.get(i); |
| 39 float bVal = b.get(i); | 39 float bVal = b.get(i); |
| 40 int aValI = *SkTCast<int*>(&aVal); | 40 int aValI = *SkTCast<int*>(&aVal); |
| 41 int bValI = *SkTCast<int*>(&bVal); | 41 int bValI = *SkTCast<int*>(&bVal); |
| 42 if (0 == aVal && 0 == bVal && aValI != bValI) { | 42 if (0 == aVal && 0 == bVal && aValI != bValI) { |
| 43 foundZeroSignDiff = true; | 43 foundZeroSignDiff = true; |
| 44 } else { | 44 } else { |
| 45 REPORTER_ASSERT(reporter, aVal == bVal && aValI == aValI); | 45 REPORTER_ASSERT(reporter, aVal == bVal && aValI == bValI); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 REPORTER_ASSERT(reporter, foundZeroSignDiff); | 48 REPORTER_ASSERT(reporter, foundZeroSignDiff); |
| 49 } else { | 49 } else { |
| 50 bool foundNaN = false; | 50 bool foundNaN = false; |
| 51 for (int i = 0; i < 9; ++i) { | 51 for (int i = 0; i < 9; ++i) { |
| 52 float aVal = a.get(i); | 52 float aVal = a.get(i); |
| 53 float bVal = b.get(i); | 53 float bVal = b.get(i); |
| 54 int aValI = *SkTCast<int*>(&aVal); | 54 int aValI = *SkTCast<int*>(&aVal); |
| 55 int bValI = *SkTCast<int*>(&bVal); | 55 int bValI = *SkTCast<int*>(&bVal); |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 a.setTranslate(10, 20); | 946 a.setTranslate(10, 20); |
| 947 | 947 |
| 948 SkMatrix b; | 948 SkMatrix b; |
| 949 b.setScale(3, 5); | 949 b.setScale(3, 5); |
| 950 | 950 |
| 951 SkMatrix expected; | 951 SkMatrix expected; |
| 952 expected.setConcat(a,b); | 952 expected.setConcat(a,b); |
| 953 | 953 |
| 954 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); | 954 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); |
| 955 } | 955 } |
| OLD | NEW |