Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: bench/InterpBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/ImageDecodeBench.cpp ('k') | bench/LightingBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkBenchmark.h" 1 #include "SkBenchmark.h"
2 #include "SkColorPriv.h" 2 #include "SkColorPriv.h"
3 #include "SkMatrix.h" 3 #include "SkMatrix.h"
4 #include "SkRandom.h" 4 #include "SkRandom.h"
5 #include "SkString.h" 5 #include "SkString.h"
6 #include "SkPaint.h" 6 #include "SkPaint.h"
7 7
8 #define TILE(x, width) (((x) & 0xFFFF) * width >> 16) 8 #define TILE(x, width) (((x) & 0xFFFF) * width >> 16)
9 9
10 class InterpBench : public SkBenchmark { 10 class InterpBench : public SkBenchmark {
(...skipping 17 matching lines...) Expand all
28 28
29 virtual void performTest(int16_t dst[], float x, float dx, int count) = 0; 29 virtual void performTest(int16_t dst[], float x, float dx, int count) = 0;
30 30
31 protected: 31 protected:
32 virtual int mulLoopCount() const { return 1; } 32 virtual int mulLoopCount() const { return 1; }
33 33
34 virtual const char* onGetName() { 34 virtual const char* onGetName() {
35 return fName.c_str(); 35 return fName.c_str();
36 } 36 }
37 37
38 virtual void onDraw(SkCanvas*) { 38 virtual void onDraw(const int loops, SkCanvas*) {
39 int n = this->getLoops() * this->mulLoopCount(); 39 int n = loops * this->mulLoopCount();
40 for (int i = 0; i < n; i++) { 40 for (int i = 0; i < n; i++) {
41 this->performTest(fDst, fFx, fDx, kBuffer); 41 this->performTest(fDst, fFx, fDx, kBuffer);
42 } 42 }
43 } 43 }
44 44
45 private: 45 private:
46 typedef SkBenchmark INHERITED; 46 typedef SkBenchmark INHERITED;
47 }; 47 };
48 48
49 class Fixed16D16Interp : public InterpBench { 49 class Fixed16D16Interp : public InterpBench {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 typedef InterpBench INHERITED; 154 typedef InterpBench INHERITED;
155 }; 155 };
156 156
157 /////////////////////////////////////////////////////////////////////////////// 157 ///////////////////////////////////////////////////////////////////////////////
158 158
159 DEF_BENCH( return new Fixed16D16Interp(); ) 159 DEF_BENCH( return new Fixed16D16Interp(); )
160 DEF_BENCH( return new Fixed32D32Interp(); ) 160 DEF_BENCH( return new Fixed32D32Interp(); )
161 DEF_BENCH( return new Fixed16D48Interp(); ) 161 DEF_BENCH( return new Fixed16D48Interp(); )
162 DEF_BENCH( return new FloatInterp(); ) 162 DEF_BENCH( return new FloatInterp(); )
163 DEF_BENCH( return new DoubleInterp(); ) 163 DEF_BENCH( return new DoubleInterp(); )
OLDNEW
« no previous file with comments | « bench/ImageDecodeBench.cpp ('k') | bench/LightingBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698