OLD | NEW |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
1 #include "Benchmark.h" | 7 #include "Benchmark.h" |
2 #include "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
3 #include "SkRandom.h" | 9 #include "SkRandom.h" |
4 #include "SkString.h" | 10 #include "SkString.h" |
5 | 11 |
6 template <bool kFast, bool kScale> | 12 template <bool kFast, bool kScale> |
7 class FourByteInterpBench : public Benchmark { | 13 class FourByteInterpBench : public Benchmark { |
8 public: | 14 public: |
9 FourByteInterpBench() { | 15 FourByteInterpBench() { |
10 fName.set("four_byte_interp"); | 16 fName.set("four_byte_interp"); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 73 |
68 private: | 74 private: |
69 SkString fName; | 75 SkString fName; |
70 static const int kInputs = 10; // Arbitrary. | 76 static const int kInputs = 10; // Arbitrary. |
71 volatile unsigned fSrcs[kInputs]; | 77 volatile unsigned fSrcs[kInputs]; |
72 volatile unsigned fDsts[kInputs]; | 78 volatile unsigned fDsts[kInputs]; |
73 unsigned fScales[257]; // We need space for [0, 256]. | 79 unsigned fScales[257]; // We need space for [0, 256]. |
74 }; | 80 }; |
75 | 81 |
76 #define COMMA , | 82 #define COMMA , |
77 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA true>); ) | 83 DEF_BENCH(return (new FourByteInterpBench<true COMMA true>);) |
78 DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA false>); ) | 84 DEF_BENCH(return (new FourByteInterpBench<true COMMA false>);) |
79 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA true>); ) | 85 DEF_BENCH(return (new FourByteInterpBench<false COMMA true>);) |
80 DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA false>); ) | 86 DEF_BENCH(return (new FourByteInterpBench<false COMMA false>);) |
81 #undef COMMA | 87 #undef COMMA |
OLD | NEW |