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

Unified Diff: bench/MatrixBench.cpp

Issue 1045493002: use Sk4f for matrix math (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkMatrix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/MatrixBench.cpp
diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp
index 68195e70e4d95ab0eb665ef82128b8f12aa2b812..e3e5c703e8d9d4f391af3aabf24aab1cb68986b8 100644
--- a/bench/MatrixBench.cpp
+++ b/bench/MatrixBench.cpp
@@ -278,10 +278,9 @@ protected:
N = 32
};
SkPoint fSrc[N], fDst[N];
- const bool fNewWay;
public:
- MapPointsMatrixBench(const char name[], const SkMatrix& m, bool newWay)
- : MatrixBench(name), fM(m), fNewWay(newWay)
+ MapPointsMatrixBench(const char name[], const SkMatrix& m)
+ : MatrixBench(name), fM(m)
{
SkRandom rand;
for (int i = 0; i < N; ++i) {
@@ -290,21 +289,13 @@ public:
}
void performTest() override {
- if (fNewWay) {
- for (int i = 0; i < 1000000; ++i) {
- fM.mapPts(fDst, fSrc, N);
- }
- } else {
- for (int i = 0; i < 1000000; ++i) {
- fM.mapPoints(fDst, fSrc, N);
- }
+ for (int i = 0; i < 1000000; ++i) {
+ fM.mapPoints(fDst, fSrc, N);
}
}
};
-DEF_BENCH( return new MapPointsMatrixBench("mappts_trans0", make_trans(), false); )
-DEF_BENCH( return new MapPointsMatrixBench("mappts_trans1", make_trans(), true); )
-DEF_BENCH( return new MapPointsMatrixBench("mappts_scale0", make_scale(), false); )
-DEF_BENCH( return new MapPointsMatrixBench("mappts_scale1", make_scale(), true); )
-DEF_BENCH( return new MapPointsMatrixBench("mappts_afine0", make_afine(), false); )
-DEF_BENCH( return new MapPointsMatrixBench("mappts_afine1", make_afine(), true); )
+DEF_BENCH( return new MapPointsMatrixBench("mappoints_identity", SkMatrix::I()); )
+DEF_BENCH( return new MapPointsMatrixBench("mappoints_trans", make_trans()); )
+DEF_BENCH( return new MapPointsMatrixBench("mappoints_scale", make_scale()); )
+DEF_BENCH( return new MapPointsMatrixBench("mappoints_affine", make_afine()); )
« no previous file with comments | « no previous file | include/core/SkMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698