OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "Benchmark.h" | 9 #include "Benchmark.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
12 | 12 |
13 #define INNER_LOOPS 100 | 13 #define INNER_LOOPS 1000 |
14 | 14 |
15 // Benchmark that draws non-AA rects or AA text with an SkXfermode::Mode. | 15 // Benchmark that draws non-AA rects or AA text with an SkXfermode::Mode. |
16 class Xfer4fBench : public Benchmark { | 16 class Xfer4fBench : public Benchmark { |
17 public: | 17 public: |
18 Xfer4fBench(SkXfermode::Mode mode, const char name[], bool doN, uint32_t fla
gs) | 18 Xfer4fBench(SkXfermode::Mode mode, const char name[], bool doN, uint32_t fla
gs) |
19 : fDoN(doN) | 19 : fDoN(doN) |
20 , fFlags(flags) | 20 , fFlags(flags) |
21 { | 21 { |
22 fProc1 = SkXfermode::GetPM4fProc1(mode, flags); | 22 fProc1 = SkXfermode::GetPM4fProc1(mode, flags); |
23 fProcN = SkXfermode::GetPM4fProcN(mode, flags); | 23 fProcN = SkXfermode::GetPM4fProcN(mode, flags); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
10); ) | 73 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
10); ) |
74 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
00); ) | 74 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
00); ) |
75 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
11); ) | 75 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
11); ) |
76 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
01); ) | 76 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", false, F
01); ) |
77 | 77 |
78 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
10); ) | 78 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
10); ) |
79 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
00); ) | 79 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
00); ) |
80 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
11); ) | 80 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
11); ) |
81 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
01); ) | 81 DEF_BENCH( return new Xfer4fBench(SkXfermode::kSrcOver_Mode, "srcover", true, F
01); ) |
OLD | NEW |