OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "Timer.h" | 8 #include "Timer.h" |
9 #include "Benchmark.h" | 9 #include "Benchmark.h" |
10 #include "LazyDecodeBitmap.h" | 10 #include "LazyDecodeBitmap.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (NULL == picture) { | 98 if (NULL == picture) { |
99 SkDebugf("Couldn't create picture. Ignoring path: %s\n", path); | 99 SkDebugf("Couldn't create picture. Ignoring path: %s\n", path); |
100 continue; | 100 continue; |
101 } | 101 } |
102 SkDebugf("Benchmarking path: %s\n", path); | 102 SkDebugf("Benchmarking path: %s\n", path); |
103 Measurement& measurement = measurements.push_back(); | 103 Measurement& measurement = measurements.push_back(); |
104 measurement.fName = path; | 104 measurement.fName = path; |
105 for (int bBoxType = 0; bBoxType < kBBoxTypeCount; ++bBoxType) { | 105 for (int bBoxType = 0; bBoxType < kBBoxTypeCount; ++bBoxType) { |
106 if (!includeBBoxType[bBoxType]) { continue; } | 106 if (!includeBBoxType[bBoxType]) { continue; } |
107 if (FLAGS_playback > 0) { | 107 if (FLAGS_playback > 0) { |
| 108 #if SK_SUPPORT_GPU |
| 109 GrContext::Options grContextOpts; |
| 110 sk_tools::TiledPictureRenderer playbackRenderer(grContextOpts); |
| 111 #else |
108 sk_tools::TiledPictureRenderer playbackRenderer; | 112 sk_tools::TiledPictureRenderer playbackRenderer; |
| 113 #endif |
109 Timer playbackTimer; | 114 Timer playbackTimer; |
110 do_benchmark_work(&playbackRenderer, (BBoxType)bBoxType, | 115 do_benchmark_work(&playbackRenderer, (BBoxType)bBoxType, |
111 picture, FLAGS_playback, &playbackTimer); | 116 picture, FLAGS_playback, &playbackTimer); |
112 measurement.fPlaybackAverage[bBoxType] = playbackTimer.fCpu; | 117 measurement.fPlaybackAverage[bBoxType] = playbackTimer.fCpu; |
113 } | 118 } |
114 if (FLAGS_record > 0) { | 119 if (FLAGS_record > 0) { |
| 120 #if SK_SUPPORT_GPU |
| 121 GrContext::Options grContextOpts; |
| 122 sk_tools::RecordPictureRenderer recordRenderer(grContextOpts); |
| 123 #else |
115 sk_tools::RecordPictureRenderer recordRenderer; | 124 sk_tools::RecordPictureRenderer recordRenderer; |
| 125 #endif |
116 Timer recordTimer; | 126 Timer recordTimer; |
117 do_benchmark_work(&recordRenderer, (BBoxType)bBoxType, | 127 do_benchmark_work(&recordRenderer, (BBoxType)bBoxType, |
118 picture, FLAGS_record, &recordTimer); | 128 picture, FLAGS_record, &recordTimer); |
119 measurement.fRecordAverage[bBoxType] = recordTimer.fCpu; | 129 measurement.fRecordAverage[bBoxType] = recordTimer.fCpu; |
120 } | 130 } |
121 } | 131 } |
122 } | 132 } |
123 | 133 |
124 Measurement globalMeasurement; | 134 Measurement globalMeasurement; |
125 for (int bBoxType = 0; bBoxType < kBBoxTypeCount; ++bBoxType) { | 135 for (int bBoxType = 0; bBoxType < kBBoxTypeCount; ++bBoxType) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 195 } |
186 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); | 196 SkDebugf("\nWrote data to gnuplot-readable files: %s %s\n", pbTitle, recTitl
e); |
187 return 0; | 197 return 0; |
188 } | 198 } |
189 | 199 |
190 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 200 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
191 int main(int argc, char** argv) { | 201 int main(int argc, char** argv) { |
192 return tool_main(argc, argv); | 202 return tool_main(argc, argv); |
193 } | 203 } |
194 #endif | 204 #endif |
OLD | NEW |