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

Unified Diff: bench/PictureRecordBench.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/PicturePlaybackBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PictureRecordBench.cpp
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index cbfad3806d1f9ef984e766280ea26ff70aa154fd..e9d2b54c4d659201552fef90b6df8f59441d71b5 100644
--- a/bench/PictureRecordBench.cpp
+++ b/bench/PictureRecordBench.cpp
@@ -16,7 +16,7 @@
class PictureRecordBench : public SkBenchmark {
public:
- PictureRecordBench(void* param, const char name[]) : INHERITED(param) {
+ PictureRecordBench(const char name[]) {
fName.printf("picture_record_%s", name);
fPictureWidth = SkIntToScalar(PICTURE_WIDTH);
fPictureHeight = SkIntToScalar(PICTURE_HEIGHT);
@@ -61,8 +61,8 @@ private:
*/
class DictionaryRecordBench : public PictureRecordBench {
public:
- DictionaryRecordBench(void* param)
- : INHERITED(param, "dictionaries") { }
+ DictionaryRecordBench()
+ : INHERITED("dictionaries") { }
protected:
virtual void recordCanvas(SkCanvas* canvas) {
@@ -123,8 +123,8 @@ private:
*/
class UniquePaintDictionaryRecordBench : public PictureRecordBench {
public:
- UniquePaintDictionaryRecordBench(void* param)
- : INHERITED(param, "unique_paint_dictionary") { }
+ UniquePaintDictionaryRecordBench()
+ : INHERITED("unique_paint_dictionary") { }
protected:
virtual void recordCanvas(SkCanvas* canvas) {
@@ -150,8 +150,8 @@ private:
*/
class RecurringPaintDictionaryRecordBench : public PictureRecordBench {
public:
- RecurringPaintDictionaryRecordBench(void* param)
- : INHERITED(param, "recurring_paint_dictionary") {
+ RecurringPaintDictionaryRecordBench()
+ : INHERITED("recurring_paint_dictionary") {
SkRandom rand;
for (int i = 0; i < ObjCount; i++) {
fPaint[i].setColor(rand.nextU());
@@ -176,10 +176,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static SkBenchmark* Fact0(void* p) { return new DictionaryRecordBench(p); }
-static SkBenchmark* Fact1(void* p) { return new UniquePaintDictionaryRecordBench(p); }
-static SkBenchmark* Fact2(void* p) { return new RecurringPaintDictionaryRecordBench(p); }
-
-static BenchRegistry gReg0(Fact0);
-static BenchRegistry gReg1(Fact1);
-static BenchRegistry gReg2(Fact2);
+DEF_BENCH( return new DictionaryRecordBench(); )
+DEF_BENCH( return new UniquePaintDictionaryRecordBench(); )
+DEF_BENCH( return new RecurringPaintDictionaryRecordBench(); )
« no previous file with comments | « bench/PicturePlaybackBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698