OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef PictureBenchmark_DEFINED | 8 #ifndef PictureBenchmark_DEFINED |
9 #define PictureBenchmark_DEFINED | 9 #define PictureBenchmark_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 #include "PictureRenderer.h" | 12 #include "PictureRenderer.h" |
| 13 #include "TimerData.h" |
13 | 14 |
14 class BenchTimer; | 15 class BenchTimer; |
15 class SkBenchLogger; | 16 class SkBenchLogger; |
16 class SkPicture; | 17 class SkPicture; |
17 class SkString; | 18 class SkString; |
18 | 19 |
19 namespace sk_tools { | 20 namespace sk_tools { |
20 | 21 |
21 class PictureBenchmark { | 22 class PictureBenchmark { |
22 public: | 23 public: |
(...skipping 15 matching lines...) Expand all Loading... |
38 * If true, tells run to log separate timing data for each individual tile.
Each tile will be | 39 * If true, tells run to log separate timing data for each individual tile.
Each tile will be |
39 * drawn fRepeats times. Requires the PictureRenderer set by setRenderer to
be a | 40 * drawn fRepeats times. Requires the PictureRenderer set by setRenderer to
be a |
40 * TiledPictureRenderer. | 41 * TiledPictureRenderer. |
41 */ | 42 */ |
42 void setTimeIndividualTiles(bool indiv) { fTimeIndividualTiles = indiv; } | 43 void setTimeIndividualTiles(bool indiv) { fTimeIndividualTiles = indiv; } |
43 | 44 |
44 bool timeIndividualTiles() { return fTimeIndividualTiles; } | 45 bool timeIndividualTiles() { return fTimeIndividualTiles; } |
45 | 46 |
46 PictureRenderer* setRenderer(PictureRenderer*); | 47 PictureRenderer* setRenderer(PictureRenderer*); |
47 | 48 |
48 void setLogPerIter(bool log) { fLogPerIter = log; } | 49 void setTimerResultType(TimerData::Result resultType) { fTimerResult = resul
tType; } |
49 | 50 |
50 void setPrintMin(bool min) { fPrintMin = min; } | 51 void setTimersToShow(bool wall, bool truncatedWall, bool cpu, bool truncated
Cpu, bool gpu); |
51 | |
52 void setTimersToShow(bool wall, bool truncatedWall, bool cpu, bool truncated
Cpu, bool gpu) { | |
53 fShowWallTime = wall; | |
54 fShowTruncatedWallTime = truncatedWall; | |
55 fShowCpuTime = cpu; | |
56 fShowTruncatedCpuTime = truncatedCpu; | |
57 fShowGpuTime = gpu; | |
58 } | |
59 | 52 |
60 void setLogger(SkBenchLogger* logger) { fLogger = logger; } | 53 void setLogger(SkBenchLogger* logger) { fLogger = logger; } |
61 | 54 |
62 private: | 55 private: |
63 int fRepeats; | 56 int fRepeats; |
64 SkBenchLogger* fLogger; | 57 SkBenchLogger* fLogger; |
65 PictureRenderer* fRenderer; | 58 PictureRenderer* fRenderer; |
66 bool fLogPerIter; | 59 TimerData::Result fTimerResult; |
67 bool fPrintMin; | 60 uint32_t fTimerTypes; // bitfield of TimerData::TimerFlags values |
68 bool fShowWallTime; | 61 bool fTimeIndividualTiles; |
69 bool fShowTruncatedWallTime; | |
70 bool fShowCpuTime; | |
71 bool fShowTruncatedCpuTime; | |
72 bool fShowGpuTime; | |
73 bool fTimeIndividualTiles; | |
74 | 62 |
75 void logProgress(const char msg[]); | 63 void logProgress(const char msg[]); |
76 | 64 |
77 BenchTimer* setupTimer(bool useGLTimer = true); | 65 BenchTimer* setupTimer(bool useGLTimer = true); |
78 }; | 66 }; |
79 | 67 |
80 } | 68 } |
81 | 69 |
82 #endif // PictureBenchmark_DEFINED | 70 #endif // PictureBenchmark_DEFINED |
OLD | NEW |