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

Unified Diff: bench/MorphologyBench.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/MergeBench.cpp ('k') | bench/MutexBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/MorphologyBench.cpp
diff --git a/bench/MorphologyBench.cpp b/bench/MorphologyBench.cpp
index 2d4b4ee4b58aa40db904fcd2edec27f4271d4c96..d042e6d3e64e54e8b5d14036ccfa6502fea64521 100644
--- a/bench/MorphologyBench.cpp
+++ b/bench/MorphologyBench.cpp
@@ -36,8 +36,8 @@ class MorphologyBench : public SkBenchmark {
SkString fName;
public:
- MorphologyBench(void* param, SkScalar rad, MorphologyType style)
- : INHERITED(param) {
+ MorphologyBench(SkScalar rad, MorphologyType style)
+ {
fRadius = rad;
fStyle = style;
const char* name = rad > 0 ? gStyleName[style] : "none";
@@ -87,30 +87,17 @@ private:
typedef SkBenchmark INHERITED;
};
-static SkBenchmark* Fact00(void* p) { return new MorphologyBench(p, SMALL, kErode_MT); }
-static SkBenchmark* Fact01(void* p) { return new MorphologyBench(p, SMALL, kDilate_MT); }
-
-static SkBenchmark* Fact10(void* p) { return new MorphologyBench(p, BIG, kErode_MT); }
-static SkBenchmark* Fact11(void* p) { return new MorphologyBench(p, BIG, kDilate_MT); }
-
-static SkBenchmark* Fact20(void* p) { return new MorphologyBench(p, REAL, kErode_MT); }
-static SkBenchmark* Fact21(void* p) { return new MorphologyBench(p, REAL, kDilate_MT); }
-
-static SkBenchmark* FactNone(void* p) { return new MorphologyBench(p, 0, kErode_MT); }
-
// Fixed point can be 100x slower than float on these tests, causing
// bench to timeout.
#ifndef SK_SCALAR_IS_FIXED
+DEF_BENCH( return new MorphologyBench(SMALL, kErode_MT); )
+DEF_BENCH( return new MorphologyBench(SMALL, kDilate_MT); )
-static BenchRegistry gReg00(Fact00);
-static BenchRegistry gReg01(Fact01);
-
-static BenchRegistry gReg10(Fact10);
-static BenchRegistry gReg11(Fact11);
-
-static BenchRegistry gReg20(Fact20);
-static BenchRegistry gReg21(Fact21);
+DEF_BENCH( return new MorphologyBench(BIG, kErode_MT); )
+DEF_BENCH( return new MorphologyBench(BIG, kDilate_MT); )
-static BenchRegistry gRegNone(FactNone);
+DEF_BENCH( return new MorphologyBench(REAL, kErode_MT); )
+DEF_BENCH( return new MorphologyBench(REAL, kDilate_MT); )
+DEF_BENCH( return new MorphologyBench(0, kErode_MT); )
#endif
« no previous file with comments | « bench/MergeBench.cpp ('k') | bench/MutexBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698