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

Unified Diff: bench/Benchmark.h

Issue 1140643004: Add _aa variants of Xfermode benches. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: go Created 5 years, 7 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 | « no previous file | bench/XfermodeBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/Benchmark.h
diff --git a/bench/Benchmark.h b/bench/Benchmark.h
index 5ba6e9110893b442f6952dfd9711c7468d03cf24..22b52ab4e879d65d061320b49f611697c7e375cf 100644
--- a/bench/Benchmark.h
+++ b/bench/Benchmark.h
@@ -13,11 +13,10 @@
#include "SkString.h"
#include "SkTRegistry.h"
-#define DEF_BENCH(code) \
-namespace { \
-static Benchmark* SK_MACRO_APPEND_LINE(factory)(void*) { code; } \
-BenchRegistry SK_MACRO_APPEND_LINE(g_R_)(SK_MACRO_APPEND_LINE(factory)); \
-}
+#define DEF_BENCH3(code, N) \
+ static BenchRegistry gBench##N([](void*) -> Benchmark* { code; });
+#define DEF_BENCH2(code, N) DEF_BENCH3(code, N)
+#define DEF_BENCH(code) DEF_BENCH2(code, __COUNTER__)
/*
* With the above macros, you can register benches as follows (at the bottom
« no previous file with comments | « no previous file | bench/XfermodeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698