| OLD | NEW |
| 1 // Main binary for DM. | 1 // Main binary for DM. |
| 2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
| 3 | 3 |
| 4 #include "SkBenchmark.h" | 4 #include "SkBenchmark.h" |
| 5 #include "SkCommandLineFlags.h" | 5 #include "SkCommandLineFlags.h" |
| 6 #include "SkForceLinking.h" | 6 #include "SkForceLinking.h" |
| 7 #include "SkGraphics.h" | 7 #include "SkGraphics.h" |
| 8 #include "SkPicture.h" | 8 #include "SkPicture.h" |
| 9 #include "SkString.h" | 9 #include "SkString.h" |
| 10 #include "Test.h" | 10 #include "Test.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 GrContextFactory::kMESA_GLContextType; | 96 GrContextFactory::kMESA_GLContextType; |
| 97 #else | 97 #else |
| 98 native; | 98 native; |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms, | 101 static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms, |
| 102 const SkTArray<SkString>& configs, | 102 const SkTArray<SkString>& configs, |
| 103 const DM::Expectations& expectations, | 103 const DM::Expectations& expectations, |
| 104 DM::Reporter* reporter, | 104 DM::Reporter* reporter, |
| 105 DM::TaskRunner* tasks) { | 105 DM::TaskRunner* tasks) { |
| 106 #define START(name, type, ...)
\ | 106 #define START(name, type, ...)
\ |
| 107 if (lowercase(configs[j]).equals(name)) {
\ | 107 if (lowercase(configs[j]).equals(name)) {
\ |
| 108 tasks->add(SkNEW_ARGS(DM::type,
\ | 108 tasks->add(SkNEW_ARGS(DM::type, (name, reporter, tasks, gms[i], ## __VA_
ARGS__))); \ |
| 109 (name, reporter, tasks, expectations, gms[i], ## __VA_ARGS__
))); \ | |
| 110 } | 109 } |
| 111 for (int i = 0; i < gms.count(); i++) { | 110 for (int i = 0; i < gms.count(); i++) { |
| 112 for (int j = 0; j < configs.count(); j++) { | 111 for (int j = 0; j < configs.count(); j++) { |
| 113 START("565", CpuGMTask, kRGB_565_SkColorType); | 112 START("565", CpuGMTask, expectations, kRGB_565_SkColorType); |
| 114 START("8888", CpuGMTask, kN32_SkColorType); | 113 START("8888", CpuGMTask, expectations, kN32_SkColorType); |
| 115 START("gpu", GpuGMTask, native, 0); | 114 START("gpu", GpuGMTask, expectations, native, 0); |
| 116 START("msaa4", GpuGMTask, native, 4); | 115 START("msaa4", GpuGMTask, expectations, native, 4); |
| 117 START("msaa16", GpuGMTask, native, 16); | 116 START("msaa16", GpuGMTask, expectations, native, 16); |
| 118 START("nvprmsaa4", GpuGMTask, nvpr, 4); | 117 START("nvprmsaa4", GpuGMTask, expectations, nvpr, 4); |
| 119 START("nvprmsaa16", GpuGMTask, nvpr, 16); | 118 START("nvprmsaa16", GpuGMTask, expectations, nvpr, 16); |
| 120 START("gpunull", GpuGMTask, null, 0); | 119 START("gpunull", GpuGMTask, expectations, null, 0); |
| 121 START("gpudebug", GpuGMTask, debug, 0); | 120 START("gpudebug", GpuGMTask, expectations, debug, 0); |
| 122 START("angle", GpuGMTask, angle, 0); | 121 START("angle", GpuGMTask, expectations, angle, 0); |
| 123 START("mesa", GpuGMTask, mesa, 0); | 122 START("mesa", GpuGMTask, expectations, mesa, 0); |
| 124 START("pdf", PDFTask, RASTERIZE_PDF_PROC); | 123 START("pdf", PDFTask, RASTERIZE_PDF_PROC); |
| 125 } | 124 } |
| 126 } | 125 } |
| 127 #undef START | 126 #undef START |
| 128 } | 127 } |
| 129 | 128 |
| 130 static void kick_off_benches(const SkTDArray<BenchRegistry::Factory>& benches, | 129 static void kick_off_benches(const SkTDArray<BenchRegistry::Factory>& benches, |
| 131 const SkTArray<SkString>& configs, | 130 const SkTArray<SkString>& configs, |
| 132 DM::Reporter* reporter, | 131 DM::Reporter* reporter, |
| 133 DM::TaskRunner* tasks) { | 132 DM::TaskRunner* tasks) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 if (stream.get() == NULL) { | 184 if (stream.get() == NULL) { |
| 186 SkDebugf("Could not read %s.\n", path.c_str()); | 185 SkDebugf("Could not read %s.\n", path.c_str()); |
| 187 exit(1); | 186 exit(1); |
| 188 } | 187 } |
| 189 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get())); | 188 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get())); |
| 190 if (pic.get() == NULL) { | 189 if (pic.get() == NULL) { |
| 191 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); | 190 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); |
| 192 exit(1); | 191 exit(1); |
| 193 } | 192 } |
| 194 | 193 |
| 195 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic.detach(), filen
ame))); | 194 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic->clone(), filen
ame))); |
| 195 tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic->clone(), filen
ame, |
| 196 RASTERIZE_PDF_PROC))); |
| 196 } | 197 } |
| 197 } | 198 } |
| 198 | 199 |
| 199 static void report_failures(const SkTArray<SkString>& failures) { | 200 static void report_failures(const SkTArray<SkString>& failures) { |
| 200 if (failures.count() == 0) { | 201 if (failures.count() == 0) { |
| 201 return; | 202 return; |
| 202 } | 203 } |
| 203 | 204 |
| 204 SkDebugf("Failures:\n"); | 205 SkDebugf("Failures:\n"); |
| 205 for (int i = 0; i < failures.count(); i++) { | 206 for (int i = 0; i < failures.count(); i++) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 reporter.getFailures(&failures); | 282 reporter.getFailures(&failures); |
| 282 report_failures(failures); | 283 report_failures(failures); |
| 283 return failures.count() > 0; | 284 return failures.count() > 0; |
| 284 } | 285 } |
| 285 | 286 |
| 286 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 287 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 287 int main(int argc, char** argv) { | 288 int main(int argc, char** argv) { |
| 288 return tool_main(argc, argv); | 289 return tool_main(argc, argv); |
| 289 } | 290 } |
| 290 #endif | 291 #endif |
| OLD | NEW |