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
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index ffd674a..e383113 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -88,7 +88,7 @@
return SkIRect::MakeXYWH(x, y, w >> 1, h >> 1);
}
- RegionBench(void* param, int count, Proc proc, const char name[]) : INHERITED(param) {
+ RegionBench(int count, Proc proc, const char name[]) {
fProc = proc;
fName.printf("region_%s_%d", name, count);
@@ -116,22 +116,12 @@
#define SMALL 16
-static SkBenchmark* gF0(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, union_proc, "union")); }
-static SkBenchmark* gF1(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sect_proc, "intersect")); }
-static SkBenchmark* gF2(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diff_proc, "difference")); }
-static SkBenchmark* gF3(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diffrect_proc, "differencerect")); }
-static SkBenchmark* gF4(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, diffrectbig_proc, "differencerectbig")); }
-static SkBenchmark* gF5(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsrect_proc, "containsrect")); }
-static SkBenchmark* gF6(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrgn_proc, "intersectsrgn")); }
-static SkBenchmark* gF7(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, sectsrect_proc, "intersectsrect")); }
-static SkBenchmark* gF8(void* p) { return SkNEW_ARGS(RegionBench, (p, SMALL, containsxy_proc, "containsxy")); }
-
-static BenchRegistry gR0(gF0);
-static BenchRegistry gR1(gF1);
-static BenchRegistry gR2(gF2);
-static BenchRegistry gR3(gF3);
-static BenchRegistry gR4(gF4);
-static BenchRegistry gR5(gF5);
-static BenchRegistry gR6(gF6);
-static BenchRegistry gR7(gF7);
-static BenchRegistry gR8(gF8);
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, union_proc, "union")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sect_proc, "intersect")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diff_proc, "difference")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diffrect_proc, "differencerect")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diffrectbig_proc, "differencerectbig")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, containsrect_proc, "containsrect")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sectsrgn_proc, "intersectsrgn")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sectsrect_proc, "intersectsrect")); )
+DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, containsxy_proc, "containsxy")); )