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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | bench/XfermodeBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Benchmark_DEFINED 8 #ifndef Benchmark_DEFINED
9 #define Benchmark_DEFINED 9 #define Benchmark_DEFINED
10 10
11 #include "SkPoint.h" 11 #include "SkPoint.h"
12 #include "SkRefCnt.h" 12 #include "SkRefCnt.h"
13 #include "SkString.h" 13 #include "SkString.h"
14 #include "SkTRegistry.h" 14 #include "SkTRegistry.h"
15 15
16 #define DEF_BENCH(code) \ 16 #define DEF_BENCH3(code, N) \
17 namespace { \ 17 static BenchRegistry gBench##N([](void*) -> Benchmark* { code; });
18 static Benchmark* SK_MACRO_APPEND_LINE(factory)(void*) { code; } \ 18 #define DEF_BENCH2(code, N) DEF_BENCH3(code, N)
19 BenchRegistry SK_MACRO_APPEND_LINE(g_R_)(SK_MACRO_APPEND_LINE(factory)); \ 19 #define DEF_BENCH(code) DEF_BENCH2(code, __COUNTER__)
20 }
21 20
22 /* 21 /*
23 * With the above macros, you can register benches as follows (at the bottom 22 * With the above macros, you can register benches as follows (at the bottom
24 * of your .cpp) 23 * of your .cpp)
25 * 24 *
26 * DEF_BENCH(return new MyBenchmark(...)) 25 * DEF_BENCH(return new MyBenchmark(...))
27 * DEF_BENCH(return new MyBenchmark(...)) 26 * DEF_BENCH(return new MyBenchmark(...))
28 * DEF_BENCH(return new MyBenchmark(...)) 27 * DEF_BENCH(return new MyBenchmark(...))
29 */ 28 */
30 29
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 int fForceAlpha; 118 int fForceAlpha;
120 SkTriState::State fDither; 119 SkTriState::State fDither;
121 uint32_t fOrMask, fClearMask; 120 uint32_t fOrMask, fClearMask;
122 121
123 typedef SkRefCnt INHERITED; 122 typedef SkRefCnt INHERITED;
124 }; 123 };
125 124
126 typedef SkTRegistry<Benchmark*(*)(void*)> BenchRegistry; 125 typedef SkTRegistry<Benchmark*(*)(void*)> BenchRegistry;
127 126
128 #endif 127 #endif
OLDNEW
« 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