OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkPM4f.h" | 9 #include "SkPM4f.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 (flags & USE_AA) ? "aa" : "bw", | 30 (flags & USE_AA) ? "aa" : "bw", |
31 fDoN ? 'N' : '1', | 31 fDoN ? 'N' : '1', |
32 (flags & SkXfermode::kSrcIsOpaque_D64Flag) ? "opaque" : "al
pha", | 32 (flags & SkXfermode::kSrcIsOpaque_D64Flag) ? "opaque" : "al
pha", |
33 (flags & SkXfermode::kDstIsFloat16_D64Flag) ? "f16" : "u16"
); | 33 (flags & SkXfermode::kDstIsFloat16_D64Flag) ? "f16" : "u16"
); |
34 | 34 |
35 for (int i = 0; i < N; ++i) { | 35 for (int i = 0; i < N; ++i) { |
36 fSrc[i] = {{ 1, 1, 1, 1 }}; | 36 fSrc[i] = {{ 1, 1, 1, 1 }}; |
37 fDst[i] = 0; | 37 fDst[i] = 0; |
38 fAAStorage[i] = i * 255 / (N - 1); | 38 fAAStorage[i] = i * 255 / (N - 1); |
39 } | 39 } |
40 | 40 |
41 if (flags & USE_AA) { | 41 if (flags & USE_AA) { |
42 fAA = fAAStorage; | 42 fAA = fAAStorage; |
43 } else { | 43 } else { |
44 fAA = nullptr; | 44 fAA = nullptr; |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 protected: | 48 protected: |
49 bool isSuitableFor(Backend backend) override { return backend == kNonRenderi
ng_Backend; } | 49 bool isSuitableFor(Backend backend) override { return backend == kNonRenderi
ng_Backend; } |
50 | 50 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F10 | USE_AA); ) | 100 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F10 | USE_AA); ) |
101 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F11 | USE_AA); ) | 101 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F11 | USE_AA); ) |
102 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F10); ) | 102 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F10); ) |
103 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F11); ) | 103 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F11); ) |
104 | 104 |
105 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F00 | USE_AA); ) | 105 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F00 | USE_AA); ) |
106 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F01 | USE_AA); ) | 106 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F01 | USE_AA); ) |
107 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F00); ) | 107 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F00); ) |
108 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F01); ) | 108 DEF_BENCH( return new XferD64Bench(MODE, NAME, false, F01); ) |
OLD | NEW |