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

Unified Diff: bench/PicturePlaybackBench.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/PerlinNoiseBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PicturePlaybackBench.cpp
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp
index 7f8fe6f06efaaa17380860b0a8a17da5e3dbdbea..9d233ec3c0f9fbf46dc76f7ee0d00f568105aade 100644
--- a/bench/PicturePlaybackBench.cpp
+++ b/bench/PicturePlaybackBench.cpp
@@ -18,7 +18,7 @@
class PicturePlaybackBench : public SkBenchmark {
public:
- PicturePlaybackBench(void* param, const char name[]) : INHERITED(param) {
+ PicturePlaybackBench(const char name[]) {
fName.printf("picture_playback_%s", name);
fPictureWidth = SkIntToScalar(PICTURE_WIDTH);
fPictureHeight = SkIntToScalar(PICTURE_HEIGHT);
@@ -69,7 +69,7 @@ private:
class TextPlaybackBench : public PicturePlaybackBench {
public:
- TextPlaybackBench(void* param) : INHERITED(param, "drawText") { }
+ TextPlaybackBench() : INHERITED("drawText") { }
protected:
virtual void recordCanvas(SkCanvas* canvas) {
SkPaint paint;
@@ -92,8 +92,8 @@ private:
class PosTextPlaybackBench : public PicturePlaybackBench {
public:
- PosTextPlaybackBench(void* param, bool drawPosH)
- : INHERITED(param, drawPosH ? "drawPosTextH" : "drawPosText")
+ PosTextPlaybackBench(bool drawPosH)
+ : INHERITED(drawPosH ? "drawPosTextH" : "drawPosText")
, fDrawPosH(drawPosH) { }
protected:
virtual void recordCanvas(SkCanvas* canvas) {
@@ -136,10 +136,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static SkBenchmark* Fact0(void* p) { return new TextPlaybackBench(p); }
-static SkBenchmark* Fact1(void* p) { return new PosTextPlaybackBench(p, true); }
-static SkBenchmark* Fact2(void* p) { return new PosTextPlaybackBench(p, false); }
-
-static BenchRegistry gReg0(Fact0);
-static BenchRegistry gReg1(Fact1);
-static BenchRegistry gReg2(Fact2);
+DEF_BENCH( return new TextPlaybackBench(); )
+DEF_BENCH( return new PosTextPlaybackBench(true); )
+DEF_BENCH( return new PosTextPlaybackBench(false); )
« no previous file with comments | « bench/PerlinNoiseBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698