OLD | NEW |
1 #include "SkBenchmark.h" | 1 #include "Benchmark.h" |
2 #include "SkColorPriv.h" | 2 #include "SkColorPriv.h" |
3 #include "SkRandom.h" | 3 #include "SkRandom.h" |
4 #include "SkString.h" | 4 #include "SkString.h" |
5 | 5 |
6 template <bool kFast, bool kScale> | 6 template <bool kFast, bool kScale> |
7 class FourByteInterpBench : public SkBenchmark { | 7 class FourByteInterpBench : public Benchmark { |
8 public: | 8 public: |
9 FourByteInterpBench() { | 9 FourByteInterpBench() { |
10 fName.set("four_byte_interp"); | 10 fName.set("four_byte_interp"); |
11 fName.append(kFast ? "_fast" : "_slow"); | 11 fName.append(kFast ? "_fast" : "_slow"); |
12 fName.append(kScale ? "_255" : "_256"); | 12 fName.append(kScale ? "_255" : "_256"); |
13 } | 13 } |
14 | 14 |
15 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { | 15 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |
16 return backend == kNonRendering_Backend; | 16 return backend == kNonRendering_Backend; |
17 } | 17 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 volatile unsigned fDsts[kInputs]; | 72 volatile unsigned fDsts[kInputs]; |
73 unsigned fScales[257]; // We need space for [0, 256]. | 73 unsigned fScales[257]; // We need space for [0, 256]. |
74 }; | 74 }; |
75 | 75 |
76 #define COMMA , | 76 #define COMMA , |
77 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA true>); ) | 77 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA true>); ) |
78 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA false>); ) | 78 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA false>); ) |
79 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA true>); ) | 79 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA true>); ) |
80 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA false>); ) | 80 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA false>); ) |
81 #undef COMMA | 81 #undef COMMA |
OLD | NEW |