aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ChecksumBench.cpp
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-13 19:52:27 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-13 19:52:27 +0000
commit410e6e80f00a6c660675c80904807a041c7b7d2a (patch)
treee6b7287001f032ae9a9e09de19db5d0867bea9e3 /bench/ChecksumBench.cpp
parentaf54a513a5b7723b53f61730afe0ad6256881749 (diff)
Refactoring: get rid of the SkBenchmark void* parameter.
While I was doing massive sed-ing, I also converted every bench to use DEF_BENCH instead of registering the ugly manual way. BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/23876006 git-svn-id: http://skia.googlecode.com/svn/trunk@11263 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/ChecksumBench.cpp')
-rw-r--r--bench/ChecksumBench.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index 7cc6008583..3e7a739e6c 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -28,7 +28,7 @@ class ComputeChecksumBench : public SkBenchmark {
ChecksumType fType;
public:
- ComputeChecksumBench(void* param, ChecksumType type) : INHERITED(param), fType(type) {
+ ComputeChecksumBench(ChecksumType type) : fType(type) {
SkRandom rand;
for (int i = 0; i < U32COUNT; ++i) {
fData[i] = rand.nextU();
@@ -88,13 +88,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static SkBenchmark* Fact0(void* p) { return new ComputeChecksumBench(p, kChecksum_ChecksumType); }
-static SkBenchmark* Fact1(void* p) { return new ComputeChecksumBench(p, kMD5_ChecksumType); }
-static SkBenchmark* Fact2(void* p) { return new ComputeChecksumBench(p, kSHA1_ChecksumType); }
-static SkBenchmark* Fact3(void* p) { return new ComputeChecksumBench(p, kMurmur3_ChecksumType); }
-
-
-static BenchRegistry gReg0(Fact0);
-static BenchRegistry gReg1(Fact1);
-static BenchRegistry gReg2(Fact2);
-static BenchRegistry gReg3(Fact3);
+DEF_BENCH( return new ComputeChecksumBench(kChecksum_ChecksumType); )
+DEF_BENCH( return new ComputeChecksumBench(kMD5_ChecksumType); )
+DEF_BENCH( return new ComputeChecksumBench(kSHA1_ChecksumType); )
+DEF_BENCH( return new ComputeChecksumBench(kMurmur3_ChecksumType); )