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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 for (int i = 0; i < 10000; ++i) { | 977 for (int i = 0; i < 10000; ++i) { |
978 SkRect src = SkRect::MakeLTRB(rand.nextSScalar1() * scale, | 978 SkRect src = SkRect::MakeLTRB(rand.nextSScalar1() * scale, |
979 rand.nextSScalar1() * scale, | 979 rand.nextSScalar1() * scale, |
980 rand.nextSScalar1() * scale, | 980 rand.nextSScalar1() * scale, |
981 rand.nextSScalar1() * scale); | 981 rand.nextSScalar1() * scale); |
982 SkRect dst[3]; | 982 SkRect dst[3]; |
983 | 983 |
984 mat.mapPoints((SkPoint*)&dst[0].fLeft, (SkPoint*)&src.fLeft, 2); | 984 mat.mapPoints((SkPoint*)&dst[0].fLeft, (SkPoint*)&src.fLeft, 2); |
985 dst[0].sort(); | 985 dst[0].sort(); |
986 mat.mapRect(&dst[1], src); | 986 mat.mapRect(&dst[1], src); |
987 dst[2] = mat.mapRectScaleTranslate(src); | 987 mat.mapRectScaleTranslate(&dst[2], src); |
988 | 988 |
989 REPORTER_ASSERT(r, dst[0] == dst[1]); | 989 REPORTER_ASSERT(r, dst[0] == dst[1]); |
990 REPORTER_ASSERT(r, dst[0] == dst[2]); | 990 REPORTER_ASSERT(r, dst[0] == dst[2]); |
991 } | 991 } |
992 } | 992 } |
OLD | NEW |