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/TextBench.cpp | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'bench/TextBench.cpp') diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp index 7aac2c0ab0..cc665b785e 100644 --- a/bench/TextBench.cpp +++ b/bench/TextBench.cpp @@ -46,8 +46,8 @@ class TextBench : public SkBenchmark { bool fDoPos; SkPoint* fPos; public: - TextBench(void* param, const char text[], int ps, - SkColor color, FontQuality fq, bool doPos = false) : INHERITED(param) { + TextBench(const char text[], int ps, + SkColor color, FontQuality fq, bool doPos = false) { fPos = NULL; fFQ = fq; fDoPos = doPos; @@ -130,30 +130,16 @@ private: #define STR "Hamburgefons" -static SkBenchmark* Fact01(void* p) { return new TextBench(p, STR, 16, 0xFF000000, kBW); } -static SkBenchmark* Fact02(void* p) { return new TextBench(p, STR, 16, 0xFFFF0000, kBW); } -static SkBenchmark* Fact03(void* p) { return new TextBench(p, STR, 16, 0x88FF0000, kBW); } +DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW); ) +DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW); ) +DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW); ) -static SkBenchmark* Fact11(void* p) { return new TextBench(p, STR, 16, 0xFF000000, kAA); } -static SkBenchmark* Fact12(void* p) { return new TextBench(p, STR, 16, 0xFFFF0000, kAA); } -static SkBenchmark* Fact13(void* p) { return new TextBench(p, STR, 16, 0x88FF0000, kAA); } +DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA); ) +DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kAA); ) +DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kAA); ) -static SkBenchmark* Fact21(void* p) { return new TextBench(p, STR, 16, 0xFF000000, kLCD); } -static SkBenchmark* Fact22(void* p) { return new TextBench(p, STR, 16, 0xFFFF0000, kLCD); } -static SkBenchmark* Fact23(void* p) { return new TextBench(p, STR, 16, 0x88FF0000, kLCD); } +DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kLCD); ) +DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) +DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) -static SkBenchmark* Fact111(void* p) { return new TextBench(p, STR, 16, 0xFF000000, kAA, true); } - -static BenchRegistry gReg01(Fact01); -static BenchRegistry gReg02(Fact02); -static BenchRegistry gReg03(Fact03); - -static BenchRegistry gReg11(Fact11); -static BenchRegistry gReg12(Fact12); -static BenchRegistry gReg13(Fact13); - -static BenchRegistry gReg21(Fact21); -static BenchRegistry gReg22(Fact22); -static BenchRegistry gReg23(Fact23); - -static BenchRegistry gReg111(Fact111); +DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, true); ) -- cgit v1.2.3