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

Unified Diff: bench/ChecksumBench.cpp

Issue 23876006: Refactoring: get rid of the SkBenchmark void* parameter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: sync to head Created 7 years, 3 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 | « bench/ChartBench.cpp ('k') | bench/ChromeBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ChecksumBench.cpp
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index 7cc600858304201bc84c70b75bcbc62e9df9b3d3..3e7a739e6cf8bc1ceafb6163e10f5c3c04ff9056 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); )
« no previous file with comments | « bench/ChartBench.cpp ('k') | bench/ChromeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698