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

Unified Diff: bench/ScalarBench.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/RepeatTileBench.cpp ('k') | bench/ShaderMaskBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ScalarBench.cpp
diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp
index b1014f4836951925c8d8dadc80cd821741153724..536af28340991b02715dc12bdba2885c5d3c1749 100644
--- a/bench/ScalarBench.cpp
+++ b/bench/ScalarBench.cpp
@@ -14,7 +14,7 @@
class ScalarBench : public SkBenchmark {
SkString fName;
public:
- ScalarBench(void* param, const char name[]) : INHERITED(param) {
+ ScalarBench(const char name[]) {
fName.printf("scalar_%s", name);
fIsRendering = false;
}
@@ -62,7 +62,7 @@ template <typename T> void init9(T array[9]) {
class FloatComparisonBench : public ScalarBench {
public:
- FloatComparisonBench(void* param) : INHERITED(param, "compare_float") {
+ FloatComparisonBench() : INHERITED("compare_float") {
init9(fArray);
}
protected:
@@ -78,8 +78,8 @@ private:
class ForcedIntComparisonBench : public ScalarBench {
public:
- ForcedIntComparisonBench(void* param)
- : INHERITED(param, "compare_forced_int") {
+ ForcedIntComparisonBench()
+ : INHERITED("compare_forced_int") {
init9(fArray);
}
protected:
@@ -99,7 +99,7 @@ private:
class IsFiniteScalarBench : public ScalarBench {
public:
- IsFiniteScalarBench(void* param) : INHERITED(param, "isfinite") {
+ IsFiniteScalarBench() : INHERITED("isfinite") {
SkRandom rand;
for (size_t i = 0; i < ARRAY_N; ++i) {
fArray[i] = rand.nextSScalar1();
@@ -137,7 +137,7 @@ class RectBoundsBench : public SkBenchmark {
SkPoint fPts[PTS];
public:
- RectBoundsBench(void* param) : INHERITED(param) {
+ RectBoundsBench() {
SkRandom rand;
for (int i = 0; i < PTS; ++i) {
fPts[i].fX = rand.nextSScalar1();
@@ -164,12 +164,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static SkBenchmark* S0(void* p) { return new FloatComparisonBench(p); }
-static SkBenchmark* S1(void* p) { return new ForcedIntComparisonBench(p); }
-static SkBenchmark* S2(void* p) { return new RectBoundsBench(p); }
-static SkBenchmark* S3(void* p) { return new IsFiniteScalarBench(p); }
-
-static BenchRegistry gReg0(S0);
-static BenchRegistry gReg1(S1);
-static BenchRegistry gReg2(S2);
-static BenchRegistry gReg3(S3);
+DEF_BENCH( return new FloatComparisonBench(); )
+DEF_BENCH( return new ForcedIntComparisonBench(); )
+DEF_BENCH( return new RectBoundsBench(); )
+DEF_BENCH( return new IsFiniteScalarBench(); )
« no previous file with comments | « bench/RepeatTileBench.cpp ('k') | bench/ShaderMaskBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698