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

Unified Diff: bench/SkBenchmark.h

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 10 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/GrMemoryPoolBench.cpp ('k') | bench/SkGMBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SkBenchmark.h
diff --git a/bench/SkBenchmark.h b/bench/SkBenchmark.h
index f1e317da60c71bb5286301e99d0b85827ed79548..bf28689236593b81cf450f29ff88fc197adc7c59 100644
--- a/bench/SkBenchmark.h
+++ b/bench/SkBenchmark.h
@@ -15,10 +15,8 @@
#define DEF_BENCH(code) \
namespace { \
-class SK_MACRO_APPEND_LINE(F_CLASS) : public SkBenchmarkFactory { \
- virtual SkBenchmark* operator()() const SK_OVERRIDE { code; } \
-} SK_MACRO_APPEND_LINE(g_F_); \
-BenchRegistry SK_MACRO_APPEND_LINE(g_R_)(&SK_MACRO_APPEND_LINE(g_F_)); \
+static SkBenchmark* SK_MACRO_APPEND_LINE(factory)(void*) { code; } \
+BenchRegistry SK_MACRO_APPEND_LINE(g_R_)(SK_MACRO_APPEND_LINE(factory)); \
}
/*
@@ -136,13 +134,6 @@ private:
typedef SkRefCnt INHERITED;
};
-class SkBenchmarkFactory : public SkRefCnt {
-public:
- // Creates a new SkBenchmark that is owned by the caller on each call.
- virtual SkBenchmark* operator()() const = 0;
- virtual ~SkBenchmarkFactory() {}
-};
-
-typedef SkTRegistry<SkBenchmarkFactory*> BenchRegistry;
+typedef SkTRegistry<SkBenchmark*(*)(void*)> BenchRegistry;
#endif
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | bench/SkGMBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698