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

Unified Diff: bench/AAClipBench.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 | « no previous file | bench/BicubicBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/AAClipBench.cpp
diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp
index 3c04bd47f77e7fbf6611172e9709b96b1a12b9d1..856411ddc9dd896376f2245f9fafe971ccc9c0a1 100644
--- a/bench/AAClipBench.cpp
+++ b/bench/AAClipBench.cpp
@@ -24,9 +24,8 @@ class AAClipBench : public SkBenchmark {
bool fDoAA;
public:
- AAClipBench(void* param, bool doPath, bool doAA)
- : INHERITED(param)
- , fDoPath(doPath)
+ AAClipBench(bool doPath, bool doAA)
+ : fDoPath(doPath)
, fDoAA(doAA) {
fName.printf("aaclip_%s_%s",
@@ -98,10 +97,7 @@ class NestedAAClipBench : public SkBenchmark {
SkPoint fSizes[kNestingDepth+1];
public:
- NestedAAClipBench(void* param, bool doAA)
- : INHERITED(param)
- , fDoAA(doAA) {
-
+ NestedAAClipBench(bool doAA) : fDoAA(doAA) {
fName.printf("nested_aaclip_%s", doAA ? "AA" : "BW");
fDrawRect = SkRect::MakeLTRB(0, 0,
@@ -184,7 +180,7 @@ class AAClipBuilderBench : public SkBenchmark {
bool fDoAA;
public:
- AAClipBuilderBench(void* param, bool doPath, bool doAA) : INHERITED(param) {
+ AAClipBuilderBench(bool doPath, bool doAA) {
fDoPath = doPath;
fDoAA = doAA;
@@ -219,7 +215,7 @@ private:
////////////////////////////////////////////////////////////////////////////////
class AAClipRegionBench : public SkBenchmark {
public:
- AAClipRegionBench(void* param) : INHERITED(param) {
+ AAClipRegionBench() {
SkPath path;
// test conversion of a complex clip to a aaclip
path.addCircle(0, 0, SkIntToScalar(200));
@@ -248,31 +244,15 @@ private:
////////////////////////////////////////////////////////////////////////////////
-static SkBenchmark* Fact0(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, false, false)); }
-static SkBenchmark* Fact1(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, false, true)); }
-static SkBenchmark* Fact2(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, true, false)); }
-static SkBenchmark* Fact3(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, true, true)); }
-
-static BenchRegistry gReg0(Fact0);
-static BenchRegistry gReg1(Fact1);
-static BenchRegistry gReg2(Fact2);
-static BenchRegistry gReg3(Fact3);
-
-static SkBenchmark* Fact01(void* p) { return SkNEW_ARGS(AAClipRegionBench, (p)); }
-static BenchRegistry gReg01(Fact01);
-
-static SkBenchmark* Fact000(void* p) { return SkNEW_ARGS(AAClipBench, (p, false, false)); }
-static SkBenchmark* Fact001(void* p) { return SkNEW_ARGS(AAClipBench, (p, false, true)); }
-static SkBenchmark* Fact002(void* p) { return SkNEW_ARGS(AAClipBench, (p, true, false)); }
-static SkBenchmark* Fact003(void* p) { return SkNEW_ARGS(AAClipBench, (p, true, true)); }
-
-static BenchRegistry gReg000(Fact000);
-static BenchRegistry gReg001(Fact001);
-static BenchRegistry gReg002(Fact002);
-static BenchRegistry gReg003(Fact003);
-
-static SkBenchmark* Fact004(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p, false)); }
-static SkBenchmark* Fact005(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p, true)); }
+DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, false)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, true)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, false)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, true)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipRegionBench, ()); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, false)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, true)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, false)); )
+DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, true)); )
+DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (false)); )
+DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (true)); )
-static BenchRegistry gReg004(Fact004);
-static BenchRegistry gReg005(Fact005);
« no previous file with comments | « no previous file | bench/BicubicBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698