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

Unified Diff: bench/DashBench.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/ColorFilterBench.cpp ('k') | bench/DecodeBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/DashBench.cpp
diff --git a/bench/DashBench.cpp b/bench/DashBench.cpp
index 84fe3ab75266e6190f93b1e04f84134c8b4e651c..040dfd568da669938bdab331eee5735804537709 100644
--- a/bench/DashBench.cpp
+++ b/bench/DashBench.cpp
@@ -38,8 +38,8 @@ protected:
bool fDoClip;
public:
- DashBench(void* param, const SkScalar intervals[], int count, int width,
- bool doClip = false) : INHERITED(param) {
+ DashBench(const SkScalar intervals[], int count, int width,
+ bool doClip = false) {
fIntervals.append(count, intervals);
for (int i = 0; i < count; ++i) {
fIntervals[i] *= width;
@@ -99,8 +99,8 @@ private:
class RectDashBench : public DashBench {
public:
- RectDashBench(void* param, const SkScalar intervals[], int count, int width)
- : INHERITED(param, intervals, count, width) {
+ RectDashBench(const SkScalar intervals[], int count, int width)
+ : INHERITED(intervals, count, width) {
fName.append("_rect");
}
@@ -181,7 +181,7 @@ class MakeDashBench : public SkBenchmark {
SkAutoTUnref<SkPathEffect> fPE;
public:
- MakeDashBench(void* param, void (*proc)(SkPath*), const char name[]) : INHERITED(param) {
+ MakeDashBench(void (*proc)(SkPath*), const char name[]) {
fName.printf("makedash_%s", name);
proc(&fPath);
@@ -218,7 +218,7 @@ class DashLineBench : public SkBenchmark {
SkAutoTUnref<SkPathEffect> fPE;
public:
- DashLineBench(void* param, SkScalar width, bool isRound) : INHERITED(param) {
+ DashLineBench(SkScalar width, bool isRound) {
fName.printf("dashline_%g_%s", SkScalarToFloat(width), isRound ? "circle" : "square");
fStrokeWidth = width;
fIsRound = isRound;
@@ -256,8 +256,8 @@ class DrawPointsDashingBench : public SkBenchmark {
SkAutoTUnref<SkPathEffect> fPathEffect;
public:
- DrawPointsDashingBench(void* param, int dashLength, int strokeWidth, bool doAA)
- : INHERITED(param) {
+ DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA)
+ {
fName.printf("drawpointsdash_%d_%d%s", dashLength, strokeWidth, doAA ? "_aa" : "_bw");
fStrokeWidth = strokeWidth;
fDoAA = doAA;
@@ -316,7 +316,7 @@ public:
return gNames[lt];
}
- GiantDashBench(void* param, LineType lt, SkScalar width) : INHERITED(param) {
+ GiantDashBench(LineType lt, SkScalar width) {
fName.printf("giantdashline_%s_%g", LineTypeName(lt), width);
fStrokeWidth = width;
@@ -380,39 +380,39 @@ static const SkScalar gDots[] = { SK_Scalar1, SK_Scalar1 };
#define PARAM(array) array, SK_ARRAY_COUNT(array)
-DEF_BENCH( return new DashBench(p, PARAM(gDots), 0); )
-DEF_BENCH( return new DashBench(p, PARAM(gDots), 1); )
-DEF_BENCH( return new DashBench(p, PARAM(gDots), 1, true); )
-DEF_BENCH( return new DashBench(p, PARAM(gDots), 4); )
-DEF_BENCH( return new MakeDashBench(p, make_poly, "poly"); )
-DEF_BENCH( return new MakeDashBench(p, make_quad, "quad"); )
-DEF_BENCH( return new MakeDashBench(p, make_cubic, "cubic"); )
-DEF_BENCH( return new DashLineBench(p, 0, false); )
-DEF_BENCH( return new DashLineBench(p, SK_Scalar1, false); )
-DEF_BENCH( return new DashLineBench(p, 2 * SK_Scalar1, false); )
-DEF_BENCH( return new DashLineBench(p, 0, true); )
-DEF_BENCH( return new DashLineBench(p, SK_Scalar1, true); )
-DEF_BENCH( return new DashLineBench(p, 2 * SK_Scalar1, true); )
-
-DEF_BENCH( return new DrawPointsDashingBench(p, 1, 1, false); )
-DEF_BENCH( return new DrawPointsDashingBench(p, 1, 1, true); )
-DEF_BENCH( return new DrawPointsDashingBench(p, 3, 1, false); )
-DEF_BENCH( return new DrawPointsDashingBench(p, 3, 1, true); )
-DEF_BENCH( return new DrawPointsDashingBench(p, 5, 5, false); )
-DEF_BENCH( return new DrawPointsDashingBench(p, 5, 5, true); )
+DEF_BENCH( return new DashBench(PARAM(gDots), 0); )
+DEF_BENCH( return new DashBench(PARAM(gDots), 1); )
+DEF_BENCH( return new DashBench(PARAM(gDots), 1, true); )
+DEF_BENCH( return new DashBench(PARAM(gDots), 4); )
+DEF_BENCH( return new MakeDashBench(make_poly, "poly"); )
+DEF_BENCH( return new MakeDashBench(make_quad, "quad"); )
+DEF_BENCH( return new MakeDashBench(make_cubic, "cubic"); )
+DEF_BENCH( return new DashLineBench(0, false); )
+DEF_BENCH( return new DashLineBench(SK_Scalar1, false); )
+DEF_BENCH( return new DashLineBench(2 * SK_Scalar1, false); )
+DEF_BENCH( return new DashLineBench(0, true); )
+DEF_BENCH( return new DashLineBench(SK_Scalar1, true); )
+DEF_BENCH( return new DashLineBench(2 * SK_Scalar1, true); )
+
+DEF_BENCH( return new DrawPointsDashingBench(1, 1, false); )
+DEF_BENCH( return new DrawPointsDashingBench(1, 1, true); )
+DEF_BENCH( return new DrawPointsDashingBench(3, 1, false); )
+DEF_BENCH( return new DrawPointsDashingBench(3, 1, true); )
+DEF_BENCH( return new DrawPointsDashingBench(5, 5, false); )
+DEF_BENCH( return new DrawPointsDashingBench(5, 5, true); )
/* Disable the GiantDashBench for Android devices until we can better control
* the memory usage. (https://code.google.com/p/skia/issues/detail?id=1430)
*/
#ifndef SK_BUILD_FOR_ANDROID
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kHori_LineType, 0); )
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kVert_LineType, 0); )
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kDiag_LineType, 0); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 0); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 0); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 0); )
// pass 2 to explicitly avoid any 1-is-the-same-as-hairline special casing
// hori_2 is just too slow to enable at the moment
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kHori_LineType, 2); )
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kVert_LineType, 2); )
-DEF_BENCH( return new GiantDashBench(p, GiantDashBench::kDiag_LineType, 2); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); )
+DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); )
#endif
« no previous file with comments | « bench/ColorFilterBench.cpp ('k') | bench/DecodeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698