Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: tests/MatrixTest.cpp

Issue 2137853002: change mapRectScaleTranslate to pass args/ret by value (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/core/SkMatrix.cpp ('K') | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 for (int i = 0; i < 10000; ++i) { 971 for (int i = 0; i < 10000; ++i) {
972 SkRect src = SkRect::MakeLTRB(rand.nextSScalar1() * scale, 972 SkRect src = SkRect::MakeLTRB(rand.nextSScalar1() * scale,
973 rand.nextSScalar1() * scale, 973 rand.nextSScalar1() * scale,
974 rand.nextSScalar1() * scale, 974 rand.nextSScalar1() * scale,
975 rand.nextSScalar1() * scale); 975 rand.nextSScalar1() * scale);
976 SkRect dst[3]; 976 SkRect dst[3];
977 977
978 mat.mapPoints((SkPoint*)&dst[0].fLeft, (SkPoint*)&src.fLeft, 2); 978 mat.mapPoints((SkPoint*)&dst[0].fLeft, (SkPoint*)&src.fLeft, 2);
979 dst[0].sort(); 979 dst[0].sort();
980 mat.mapRect(&dst[1], src); 980 mat.mapRect(&dst[1], src);
981 mat.mapRectScaleTranslate(&dst[2], src); 981 dst[2] = mat.mapRectScaleTranslate(src);
982 982
983 REPORTER_ASSERT(r, dst[0] == dst[1]); 983 REPORTER_ASSERT(r, dst[0] == dst[1]);
984 REPORTER_ASSERT(r, dst[0] == dst[2]); 984 REPORTER_ASSERT(r, dst[0] == dst[2]);
985 } 985 }
986 } 986 }
OLDNEW
« src/core/SkMatrix.cpp ('K') | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698