OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkMatrix.h" | 10 #include "SkMatrix.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 virtual void performTest(int16_t dst[], float x, float dx, int count) = 0; | 36 virtual void performTest(int16_t dst[], float x, float dx, int count) = 0; |
37 | 37 |
38 protected: | 38 protected: |
39 virtual int mulLoopCount() const { return 1; } | 39 virtual int mulLoopCount() const { return 1; } |
40 | 40 |
41 const char* onGetName() override { | 41 const char* onGetName() override { |
42 return fName.c_str(); | 42 return fName.c_str(); |
43 } | 43 } |
44 | 44 |
45 void onDraw(const int loops, SkCanvas*) override { | 45 void onDraw(int loops, SkCanvas*) override { |
46 int n = loops * this->mulLoopCount(); | 46 int n = loops * this->mulLoopCount(); |
47 for (int i = 0; i < n; i++) { | 47 for (int i = 0; i < n; i++) { |
48 this->performTest(fDst, fFx, fDx, kBuffer); | 48 this->performTest(fDst, fFx, fDx, kBuffer); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 private: | 52 private: |
53 typedef Benchmark INHERITED; | 53 typedef Benchmark INHERITED; |
54 }; | 54 }; |
55 | 55 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 typedef InterpBench INHERITED; | 161 typedef InterpBench INHERITED; |
162 }; | 162 }; |
163 | 163 |
164 /////////////////////////////////////////////////////////////////////////////// | 164 /////////////////////////////////////////////////////////////////////////////// |
165 | 165 |
166 DEF_BENCH( return new Fixed16D16Interp(); ) | 166 DEF_BENCH( return new Fixed16D16Interp(); ) |
167 DEF_BENCH( return new Fixed32D32Interp(); ) | 167 DEF_BENCH( return new Fixed32D32Interp(); ) |
168 DEF_BENCH( return new Fixed16D48Interp(); ) | 168 DEF_BENCH( return new Fixed16D48Interp(); ) |
169 DEF_BENCH( return new FloatInterp(); ) | 169 DEF_BENCH( return new FloatInterp(); ) |
170 DEF_BENCH( return new DoubleInterp(); ) | 170 DEF_BENCH( return new DoubleInterp(); ) |
OLD | NEW |