DM: also run benches once.
Also:
- make GrMemoryPoolBenches threadsafe
- some tweaks to various DM code
- rename GM::shortName() to getName() to match benches and tests
On my desktop, (289 GMs, 617 benches) x 4 configs, 227 tests takes 46s in Debug, 14s in Release. (Still minutes faster than running tests && bench && gm.) GPU singlethreading is definitely the limiting factor again; going to reexamine whether that's helpful to thread it again.
BUG=skia:
R=reed@google.com, bsalomon@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/178473006
git-svn-id: http://skia.googlecode.com/svn/trunk@13603 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/SkBenchmark.h b/bench/SkBenchmark.h
index f1e317d..bf28689 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 @@
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