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

Unified Diff: bench/XfermodeBench.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/WriterBench.cpp ('k') | bench/benchmain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/XfermodeBench.cpp
diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp
index 993fc8f7b122475a83ff6a9faf683e73dd65c90b..aed4c3478cddd0b9b1218c2183d5129133d4ab9b 100644
--- a/bench/XfermodeBench.cpp
+++ b/bench/XfermodeBench.cpp
@@ -17,14 +17,13 @@
// Benchmark that draws non-AA rects with an SkXfermode::Mode
class XfermodeBench : public SkBenchmark {
public:
- XfermodeBench(void* param, SkXfermode::Mode mode) : SkBenchmark(param) {
+ XfermodeBench(SkXfermode::Mode mode) {
fXfermode.reset(SkXfermode::Create(mode));
SkASSERT(NULL != fXfermode.get() || SkXfermode::kSrcOver_Mode == mode);
fName.printf("Xfermode_%s", SkXfermode::ModeName(mode));
}
- XfermodeBench(void* param, SkXfermode* xferMode, const char* name)
- : SkBenchmark(param) {
+ XfermodeBench(SkXfermode* xferMode, const char* name) {
SkASSERT(NULL != xferMode);
fXfermode.reset(xferMode);
fName.printf("Xfermode_%s", name);
@@ -68,8 +67,8 @@ private:
#define CONCAT_I(x, y) x ## y
#define CONCAT(x, y) CONCAT_I(x, y) // allow for macro expansion
#define BENCH(...) \
- static SkBenchmark* CONCAT(Fact, __LINE__)(void *p) { return new XfermodeBench(p, __VA_ARGS__); };\
- static BenchRegistry CONCAT(gReg, __LINE__)(CONCAT(Fact, __LINE__));
+ DEF_BENCH( return new XfermodeBench(__VA_ARGS__); );\
+
BENCH(SkXfermode::kClear_Mode)
BENCH(SkXfermode::kSrc_Mode)
« no previous file with comments | « bench/WriterBench.cpp ('k') | bench/benchmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698