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

Unified Diff: bench/RectBench.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/ReadPixBench.cpp ('k') | bench/RectoriBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RectBench.cpp
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index 22c26456e3b264b4e99bc361924507e5a3370408..2937e5dafe5137f493ecf200ec997c7cddb80313 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -26,9 +26,8 @@ public:
SkRect fRects[N];
SkColor fColors[N];
- RectBench(void* param, int shift, int stroke = 0)
- : INHERITED(param)
- , fShift(shift)
+ RectBench(int shift, int stroke = 0)
+ : fShift(shift)
, fStroke(stroke) {
SkRandom rand;
const SkScalar offset = SK_Scalar1/3;
@@ -81,7 +80,7 @@ private:
class SrcModeRectBench : public RectBench {
public:
- SrcModeRectBench(void* param) : INHERITED(param, 1, 0) {
+ SrcModeRectBench() : INHERITED(1, 0) {
fMode = SkXfermode::Create(SkXfermode::kSrc_Mode);
}
@@ -112,7 +111,7 @@ private:
class OvalBench : public RectBench {
public:
- OvalBench(void* param, int shift, int stroke = 0) : RectBench(param, shift, stroke) {}
+ OvalBench(int shift, int stroke = 0) : RectBench(shift, stroke) {}
protected:
virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {
c->drawOval(r, p);
@@ -122,7 +121,7 @@ protected:
class RRectBench : public RectBench {
public:
- RRectBench(void* param, int shift, int stroke = 0) : RectBench(param, shift, stroke) {}
+ RRectBench(int shift, int stroke = 0) : RectBench(shift, stroke) {}
protected:
virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {
c->drawRoundRect(r, r.width() / 4, r.height() / 4, p);
@@ -135,8 +134,9 @@ public:
SkCanvas::PointMode fMode;
const char* fName;
- PointsBench(void* param, SkCanvas::PointMode mode, const char* name) :
- RectBench(param, 2), fMode(mode) {
+ PointsBench(SkCanvas::PointMode mode, const char* name)
+ : RectBench(2)
+ , fMode(mode) {
fName = name;
}
@@ -174,7 +174,7 @@ public:
H = 480,
};
- AARectBench(void* param, bool rotate) : INHERITED(param), fRotate(rotate) {}
+ AARectBench(bool rotate) : fRotate(rotate) {}
protected:
@@ -236,9 +236,9 @@ public:
SkCanvas::PointMode fMode;
const char* fName;
- BlitMaskBench(void* param, SkCanvas::PointMode mode,
+ BlitMaskBench(SkCanvas::PointMode mode,
BlitMaskBench::kMaskType type, const char* name) :
- RectBench(param, 2), fMode(mode), _type(type) {
+ RectBench(2), fMode(mode), _type(type) {
fName = name;
}
@@ -302,42 +302,42 @@ private:
};
-DEF_BENCH( return SkNEW_ARGS(RectBench, (p, 1)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (p, 1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (p, 3)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (p, 3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (p, 1)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (p, 3)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (p, 1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (p, 3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (p, 1)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (p, 1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (p, 3)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (p, 3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (p, SkCanvas::kPoints_PointMode, "points")); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (p, SkCanvas::kLines_PointMode, "lines")); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (p, SkCanvas::kPolygon_PointMode, "polygon")); )
+DEF_BENCH( return SkNEW_ARGS(RectBench, (1)); )
+DEF_BENCH( return SkNEW_ARGS(RectBench, (1, 4)); )
+DEF_BENCH( return SkNEW_ARGS(RectBench, (3)); )
+DEF_BENCH( return SkNEW_ARGS(RectBench, (3, 4)); )
+DEF_BENCH( return SkNEW_ARGS(OvalBench, (1)); )
+DEF_BENCH( return SkNEW_ARGS(OvalBench, (3)); )
+DEF_BENCH( return SkNEW_ARGS(OvalBench, (1, 4)); )
+DEF_BENCH( return SkNEW_ARGS(OvalBench, (3, 4)); )
+DEF_BENCH( return SkNEW_ARGS(RRectBench, (1)); )
+DEF_BENCH( return SkNEW_ARGS(RRectBench, (1, 4)); )
+DEF_BENCH( return SkNEW_ARGS(RRectBench, (3)); )
+DEF_BENCH( return SkNEW_ARGS(RRectBench, (3, 4)); )
+DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kPoints_PointMode, "points")); )
+DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kLines_PointMode, "lines")); )
+DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kPolygon_PointMode, "polygon")); )
-DEF_BENCH( return SkNEW_ARGS(SrcModeRectBench, (p)); )
+DEF_BENCH( return SkNEW_ARGS(SrcModeRectBench, ()); )
-DEF_BENCH( return SkNEW_ARGS(AARectBench, (p, false)); )
-DEF_BENCH( return SkNEW_ARGS(AARectBench, (p, true)); )
+DEF_BENCH( return SkNEW_ARGS(AARectBench, (false)); )
+DEF_BENCH( return SkNEW_ARGS(AARectBench, (true)); )
/* init the blitmask bench
*/
DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (p, SkCanvas::kPoints_PointMode,
+ (SkCanvas::kPoints_PointMode,
BlitMaskBench::kMaskOpaque, "maskopaque")
); )
DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (p, SkCanvas::kPoints_PointMode,
+ (SkCanvas::kPoints_PointMode,
BlitMaskBench::kMaskBlack, "maskblack")
); )
DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (p, SkCanvas::kPoints_PointMode,
+ (SkCanvas::kPoints_PointMode,
BlitMaskBench::kMaskColor, "maskcolor")
); )
DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (p, SkCanvas::kPoints_PointMode,
+ (SkCanvas::kPoints_PointMode,
BlitMaskBench::KMaskShader, "maskshader")
); )
« no previous file with comments | « bench/ReadPixBench.cpp ('k') | bench/RectoriBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698