From 410e6e80f00a6c660675c80904807a041c7b7d2a Mon Sep 17 00:00:00 2001 From: "mtklein@google.com" Date: Fri, 13 Sep 2013 19:52:27 +0000 Subject: 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 --- bench/ChecksumBench.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'bench/ChecksumBench.cpp') 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); ) -- cgit v1.2.3