diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-28 15:34:49 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-28 15:34:49 +0000 |
commit | ca529d303e50072aa25405c651b16f96b5b3fa4b (patch) | |
tree | 32ba9dd8ced02ba98a4ac128b98f605656ebd0e9 /bench/MatrixBench.cpp | |
parent | 8382394bf260af223d5217ff8c45961f149bf1cf (diff) |
In debug builds, only run each benchmark 1 time (test for assertion-breakage,
not performance).
codereview.appspot.com/5314064/
git-svn-id: http://skia.googlecode.com/svn/trunk@2552 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/MatrixBench.cpp')
-rw-r--r-- | bench/MatrixBench.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp index 06669719fe..d88b41db62 100644 --- a/bench/MatrixBench.cpp +++ b/bench/MatrixBench.cpp @@ -28,7 +28,7 @@ protected: } virtual void onDraw(SkCanvas* canvas) { - int n = N * this->mulLoopCount(); + int n = SkBENCHLOOP(N * this->mulLoopCount()); for (int i = 0; i < n; i++) { this->performTest(); } @@ -271,7 +271,7 @@ class ScaleTransMixedMatrixBench : public MatrixBench { fRandom.nextS(), fRandom.nextS(), fRandom.nextS(), fRandom.nextS(), fRandom.nextS(), fRandom.nextS()); int i; - for (i = 0; i < fCount; i++) { + for (i = 0; i < SkBENCHLOOP(fCount); i++) { fSrc[i].fX = fRandom.nextSScalar1(); fSrc[i].fY = fRandom.nextSScalar1(); fDst[i].fX = fRandom.nextSScalar1(); @@ -282,7 +282,7 @@ class ScaleTransMixedMatrixBench : public MatrixBench { virtual void performTest() { SkPoint* dst = fDst; const SkPoint* src = fSrc; - int count = fCount; + int count = SkBENCHLOOP(fCount); float mx = fMatrix[SkMatrix::kMScaleX]; float my = fMatrix[SkMatrix::kMScaleY]; float tx = fMatrix[SkMatrix::kMTransX]; @@ -308,7 +308,7 @@ class ScaleTransDoubleMatrixBench : public MatrixBench { ScaleTransDoubleMatrixBench(void* p) : INHERITED(p, "scaletrans_double"), fCount (16) { init9(fMatrix); int i; - for (i = 0; i < fCount; i++) { + for (i = 0; i < SkBENCHLOOP(fCount); i++) { fSrc[i].fX = fRandom.nextSScalar1(); fSrc[i].fY = fRandom.nextSScalar1(); fDst[i].fX = fRandom.nextSScalar1(); @@ -319,7 +319,7 @@ class ScaleTransDoubleMatrixBench : public MatrixBench { virtual void performTest() { SkPoint* dst = fDst; const SkPoint* src = fSrc; - int count = fCount; + int count = SkBENCHLOOP(fCount); // As doubles, on Z600 Linux systems this is 2.5x as expensive as mixed mode float mx = (float) fMatrix[SkMatrix::kMScaleX]; float my = (float) fMatrix[SkMatrix::kMScaleY]; |