| OLD | NEW |
| 1 #include "CrashHandler.h" | 1 #include "CrashHandler.h" |
| 2 // #include "OverwriteLine.h" | 2 // #include "OverwriteLine.h" |
| 3 #include "Resources.h" | 3 #include "Resources.h" |
| 4 #include "SkBitmap.h" | 4 #include "SkBitmap.h" |
| 5 #include "SkCanvas.h" | 5 #include "SkCanvas.h" |
| 6 #include "SkColor.h" | 6 #include "SkColor.h" |
| 7 #include "SkColorPriv.h" | 7 #include "SkColorPriv.h" |
| 8 #include "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
| 9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| 11 #include "SkGraphics.h" | 11 #include "SkGraphics.h" |
| 12 #include "SkImageDecoder.h" | 12 #include "SkImageDecoder.h" |
| 13 #include "SkImageEncoder.h" | 13 #include "SkImageEncoder.h" |
| 14 #include "SkOSFile.h" | 14 #include "SkOSFile.h" |
| 15 #include "SkPathOpsDebug.h" | 15 #include "SkPathOpsDebug.h" |
| 16 #include "SkPicture.h" | 16 #include "SkPicture.h" |
| 17 #include "SkRTConf.h" | 17 #include "SkRTConf.h" |
| 18 #include "SkTSort.h" | 18 #include "SkTSort.h" |
| 19 #include "SkStream.h" | 19 #include "SkStream.h" |
| 20 #include "SkString.h" | 20 #include "SkString.h" |
| 21 #include "SkTArray.h" | 21 #include "SkTArray.h" |
| 22 #include "SkTDArray.h" | 22 #include "SkTDArray.h" |
| 23 #include "SkTaskGroup.h" | |
| 24 #include "SkTemplates.h" | 23 #include "SkTemplates.h" |
| 24 #include "SkThreadPool.h" |
| 25 #include "SkTime.h" | 25 #include "SkTime.h" |
| 26 | 26 |
| 27 __SK_FORCE_IMAGE_DECODER_LINKING; | 27 __SK_FORCE_IMAGE_DECODER_LINKING; |
| 28 | 28 |
| 29 /* add local exceptions here */ | 29 /* add local exceptions here */ |
| 30 /* TODO : add command flag interface */ | 30 /* TODO : add command flag interface */ |
| 31 const struct SkipOverTest { | 31 const struct SkipOverTest { |
| 32 int directory; | 32 int directory; |
| 33 const char* filename; | 33 const char* filename; |
| 34 bool blamePathOps; | 34 bool blamePathOps; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 static SkString get_in_path(int dirNo, const char* filename) { | 83 static SkString get_in_path(int dirNo, const char* filename) { |
| 84 SkString path; | 84 SkString path; |
| 85 SkASSERT(dirNo); | 85 SkASSERT(dirNo); |
| 86 path.appendf("%s%d%s", IN_DIR_PRE, dirNo, DIR_POST); | 86 path.appendf("%s%d%s", IN_DIR_PRE, dirNo, DIR_POST); |
| 87 if (!sk_exists(path.c_str())) { | 87 if (!sk_exists(path.c_str())) { |
| 88 SkDebugf("could not read %s\n", path.c_str()); | 88 SkDebugf("could not read %s\n", path.c_str()); |
| 89 return SkString(); | 89 return SkString(); |
| 90 } | 90 } |
| 91 if (filename) { | 91 if (filename) { |
| 92 path.appendf("%s%s", PATH_SLASH, filename); | 92 path.appendf("%s%s", PATH_SLASH, filename); |
| 93 if (!sk_exists(path.c_str())) { | 93 if (!sk_exists(path.c_str())) { |
| 94 SkDebugf("could not read %s\n", path.c_str()); | 94 SkDebugf("could not read %s\n", path.c_str()); |
| 95 return SkString(); | 95 return SkString(); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 return path; | 98 return path; |
| 99 } | 99 } |
| 100 | 100 |
| 101 static void make_recursive_dir(const SkString& path) { | 101 static void make_recursive_dir(const SkString& path) { |
| 102 if (sk_exists(path.c_str())) { | 102 if (sk_exists(path.c_str())) { |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 const char* pathStr = path.c_str(); | 105 const char* pathStr = path.c_str(); |
| 106 int last = (int) path.size(); | 106 int last = (int) path.size(); |
| 107 do { | 107 do { |
| 108 while (last > 0 && pathStr[--last] != PATH_SLASH[0]) | 108 while (last > 0 && pathStr[--last] != PATH_SLASH[0]) |
| 109 ; | 109 ; |
| 110 SkASSERT(last > 0); | 110 SkASSERT(last > 0); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 static SkString get_out_path(int dirNo, const char* dirName) { | 124 static SkString get_out_path(int dirNo, const char* dirName) { |
| 125 SkString path; | 125 SkString path; |
| 126 SkASSERT(dirNo); | 126 SkASSERT(dirNo); |
| 127 SkASSERT(dirName); | 127 SkASSERT(dirName); |
| 128 path.appendf("%s%d%s%s%s", OUT_DIR_PRE, dirNo, DIR_POST, PATH_SLASH, dirName
); | 128 path.appendf("%s%d%s%s%s", OUT_DIR_PRE, dirNo, DIR_POST, PATH_SLASH, dirName
); |
| 129 make_recursive_dir(path); | 129 make_recursive_dir(path); |
| 130 return path; | 130 return path; |
| 131 } | 131 } |
| 132 | 132 |
| 133 static SkString get_sum_path(const char* dirName) { | 133 static SkString get_sum_path(const char* dirName) { |
| 134 SkString path; | 134 SkString path; |
| 135 SkASSERT(dirName); | 135 SkASSERT(dirName); |
| 136 path.appendf("%s%d%s%s", OUT_DIR_SUM, SUMMARY_RUN, PATH_SLASH, dirName); | 136 path.appendf("%s%d%s%s", OUT_DIR_SUM, SUMMARY_RUN, PATH_SLASH, dirName); |
| 137 SkDebugf("%s\n", path.c_str()); | 137 SkDebugf("%s\n", path.c_str()); |
| 138 make_recursive_dir(path); | 138 make_recursive_dir(path); |
| 139 return path; | 139 return path; |
| 140 } | 140 } |
| 141 | 141 |
| 142 static SkString make_png_name(const char* filename) { | 142 static SkString make_png_name(const char* filename) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 159 kSmallLimit = 1000, | 159 kSmallLimit = 1000, |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 struct TestResult { | 162 struct TestResult { |
| 163 void init(int dirNo) { | 163 void init(int dirNo) { |
| 164 fDirNo = dirNo; | 164 fDirNo = dirNo; |
| 165 sk_bzero(fFilename, sizeof(fFilename)); | 165 sk_bzero(fFilename, sizeof(fFilename)); |
| 166 fTestStep = kCompareBits; | 166 fTestStep = kCompareBits; |
| 167 fScale = 1; | 167 fScale = 1; |
| 168 } | 168 } |
| 169 | 169 |
| 170 void init(int dirNo, const SkString& filename) { | 170 void init(int dirNo, const SkString& filename) { |
| 171 fDirNo = dirNo; | 171 fDirNo = dirNo; |
| 172 strcpy(fFilename, filename.c_str()); | 172 strcpy(fFilename, filename.c_str()); |
| 173 fTestStep = kCompareBits; | 173 fTestStep = kCompareBits; |
| 174 fScale = 1; | 174 fScale = 1; |
| 175 } | 175 } |
| 176 | 176 |
| 177 SkString status() { | 177 SkString status() { |
| 178 SkString outStr; | 178 SkString outStr; |
| 179 outStr.printf("%s %d %d\n", fFilename, fPixelError, fTime); | 179 outStr.printf("%s %d %d\n", fFilename, fPixelError, fTime); |
| 180 return outStr; | 180 return outStr; |
| 181 } | 181 } |
| 182 | 182 |
| 183 SkString progress() { | 183 SkString progress() { |
| 184 SkString outStr; | 184 SkString outStr; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 197 | 197 |
| 198 } | 198 } |
| 199 | 199 |
| 200 void test(int dirNo, const SkString& filename) { | 200 void test(int dirNo, const SkString& filename) { |
| 201 init(dirNo); | 201 init(dirNo); |
| 202 strcpy(fFilename, filename.c_str()); | 202 strcpy(fFilename, filename.c_str()); |
| 203 testOne(); | 203 testOne(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void testOne(); | 206 void testOne(); |
| 207 | 207 |
| 208 char fFilename[kMaxLength]; | 208 char fFilename[kMaxLength]; |
| 209 TestStep fTestStep; | 209 TestStep fTestStep; |
| 210 int fDirNo; | 210 int fDirNo; |
| 211 int fPixelError; | 211 int fPixelError; |
| 212 int fTime; | 212 int fTime; |
| 213 int fScale; | 213 int fScale; |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 class SortByPixel : public TestResult { | 216 class SortByPixel : public TestResult { |
| 217 public: | 217 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 238 void init(int dirNo) { | 238 void init(int dirNo) { |
| 239 fResult.init(dirNo); | 239 fResult.init(dirNo); |
| 240 } | 240 } |
| 241 | 241 |
| 242 SkTDArray<SortByPixel> fPixelWorst; | 242 SkTDArray<SortByPixel> fPixelWorst; |
| 243 SkTDArray<SortByTime> fSlowest; | 243 SkTDArray<SortByTime> fSlowest; |
| 244 TestResult fResult; | 244 TestResult fResult; |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 struct TestRunner { | 247 struct TestRunner { |
| 248 TestRunner(int threadCount) |
| 249 : fNumThreads(threadCount) { |
| 250 } |
| 251 |
| 248 ~TestRunner(); | 252 ~TestRunner(); |
| 249 void render(); | 253 void render(); |
| 254 int fNumThreads; |
| 250 SkTDArray<class TestRunnable*> fRunnables; | 255 SkTDArray<class TestRunnable*> fRunnables; |
| 251 }; | 256 }; |
| 252 | 257 |
| 253 class TestRunnable : public SkRunnable { | 258 class TestRunnable : public SkRunnable { |
| 254 public: | 259 public: |
| 255 virtual void run() SK_OVERRIDE { | 260 virtual void run() SK_OVERRIDE { |
| 256 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); | 261 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); |
| 257 (*fTestFun)(&fState); | 262 (*fTestFun)(&fState); |
| 258 } | 263 } |
| 259 | 264 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 288 } | 293 } |
| 289 }; | 294 }; |
| 290 | 295 |
| 291 TestRunner::~TestRunner() { | 296 TestRunner::~TestRunner() { |
| 292 for (int index = 0; index < fRunnables.count(); index++) { | 297 for (int index = 0; index < fRunnables.count(); index++) { |
| 293 SkDELETE(fRunnables[index]); | 298 SkDELETE(fRunnables[index]); |
| 294 } | 299 } |
| 295 } | 300 } |
| 296 | 301 |
| 297 void TestRunner::render() { | 302 void TestRunner::render() { |
| 298 SkTaskGroup tg; | 303 SkThreadPool pool(fNumThreads); |
| 299 for (int index = 0; index < fRunnables.count(); ++ index) { | 304 for (int index = 0; index < fRunnables.count(); ++ index) { |
| 300 tg.add(fRunnables[index]); | 305 pool.add(fRunnables[index]); |
| 301 } | 306 } |
| 302 } | 307 } |
| 303 | 308 |
| 304 //////////////////////////////////////////////// | 309 //////////////////////////////////////////////// |
| 305 | 310 |
| 306 | 311 |
| 307 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) { | 312 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) { |
| 308 const int kRowCount = 3; | 313 const int kRowCount = 3; |
| 309 const int kThreshold = 3; | 314 const int kThreshold = 3; |
| 310 int width = SkTMin(gr.width(), sk.width()); | 315 int width = SkTMin(gr.width(), sk.width()); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 "~ causes a matching test to always be skipped\n" | 524 "~ causes a matching test to always be skipped\n" |
| 520 "^ requires the start of the test to match\n" | 525 "^ requires the start of the test to match\n" |
| 521 "$ requires the end of the test to match\n" | 526 "$ requires the end of the test to match\n" |
| 522 "^ and $ requires an exact match\n" | 527 "^ and $ requires an exact match\n" |
| 523 "If a test does not match any list entry,\n" | 528 "If a test does not match any list entry,\n" |
| 524 "it is skipped unless some list entry starts with ~"); | 529 "it is skipped unless some list entry starts with ~"); |
| 525 DEFINE_string2(dir, d, NULL, "range of directories (e.g., 1-100)"); | 530 DEFINE_string2(dir, d, NULL, "range of directories (e.g., 1-100)"); |
| 526 DEFINE_string2(skp, s, NULL, "skp to test"); | 531 DEFINE_string2(skp, s, NULL, "skp to test"); |
| 527 DEFINE_bool2(single, z, false, "run tests on a single thread internally."); | 532 DEFINE_bool2(single, z, false, "run tests on a single thread internally."); |
| 528 DEFINE_int32(testIndex, 0, "override local test index (PathOpsSkpClipOneOff only
)."); | 533 DEFINE_int32(testIndex, 0, "override local test index (PathOpsSkpClipOneOff only
)."); |
| 534 DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
| 535 "Run threadsafe tests on a threadpool with this many threads."); |
| 529 DEFINE_bool2(verbose, v, false, "enable verbose output."); | 536 DEFINE_bool2(verbose, v, false, "enable verbose output."); |
| 530 | 537 |
| 531 static bool verbose() { | 538 static bool verbose() { |
| 532 return FLAGS_verbose; | 539 return FLAGS_verbose; |
| 533 } | 540 } |
| 534 | 541 |
| 542 static int getThreadCount() { |
| 543 return FLAGS_single ? 1 : FLAGS_threads; |
| 544 } |
| 545 |
| 535 class Dirs { | 546 class Dirs { |
| 536 public: | 547 public: |
| 537 Dirs() { | 548 Dirs() { |
| 538 reset(); | 549 reset(); |
| 539 sk_bzero(fRun, sizeof(fRun)); | 550 sk_bzero(fRun, sizeof(fRun)); |
| 540 fSet = false; | 551 fSet = false; |
| 541 } | 552 } |
| 542 | 553 |
| 543 int first() const { | 554 int first() const { |
| 544 int index = 0; | 555 int index = 0; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 Filenames() | 609 Filenames() |
| 599 : fIndex(-1) { | 610 : fIndex(-1) { |
| 600 } | 611 } |
| 601 | 612 |
| 602 const char* next() { | 613 const char* next() { |
| 603 while (fNames && ++fIndex < fNames->count()) { | 614 while (fNames && ++fIndex < fNames->count()) { |
| 604 return (*fNames)[fIndex]; | 615 return (*fNames)[fIndex]; |
| 605 } | 616 } |
| 606 return NULL; | 617 return NULL; |
| 607 } | 618 } |
| 608 | 619 |
| 609 void set(const SkCommandLineFlags::StringArray& names) { | 620 void set(const SkCommandLineFlags::StringArray& names) { |
| 610 fNames = &names; | 621 fNames = &names; |
| 611 } | 622 } |
| 612 | 623 |
| 613 private: | 624 private: |
| 614 int fIndex; | 625 int fIndex; |
| 615 const SkCommandLineFlags::StringArray* fNames; | 626 const SkCommandLineFlags::StringArray* fNames; |
| 616 } gNames; | 627 } gNames; |
| 617 | 628 |
| 618 static bool buildTestDir(int dirNo, int firstDirNo, | 629 static bool buildTestDir(int dirNo, int firstDirNo, |
| 619 SkTDArray<TestResult>* tests, SkTDArray<SortByName*>* sorted) { | 630 SkTDArray<TestResult>* tests, SkTDArray<SortByName*>* sorted) { |
| 620 SkString dirName = get_out_path(dirNo, outStatusDir); | 631 SkString dirName = get_out_path(dirNo, outStatusDir); |
| 621 if (!dirName.size()) { | 632 if (!dirName.size()) { |
| 622 return false; | 633 return false; |
| 623 } | 634 } |
| 624 SkOSFile::Iter iter(dirName.c_str(), "skp"); | 635 SkOSFile::Iter iter(dirName.c_str(), "skp"); |
| 625 SkString filename; | 636 SkString filename; |
| 626 while (iter.next(&filename)) { | 637 while (iter.next(&filename)) { |
| 627 TestResult test; | 638 TestResult test; |
| 628 test.init(dirNo); | 639 test.init(dirNo); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 785 } |
| 775 if (slowest.count() > 0) { | 786 if (slowest.count() > 0) { |
| 776 SkTQSort<SortByTime>(slowest.begin(), slowest.end() - 1); | 787 SkTQSort<SortByTime>(slowest.begin(), slowest.end() - 1); |
| 777 for (int index = 0; index < slowest.count(); ++index) { | 788 for (int index = 0; index < slowest.count(); ++index) { |
| 778 const TestResult& result = *slowest[index]; | 789 const TestResult& result = *slowest[index]; |
| 779 SkDebugf("%d %s time=%d\n", result.fDirNo, result.fFilename,
result.fTime); | 790 SkDebugf("%d %s time=%d\n", result.fDirNo, result.fFilename,
result.fTime); |
| 780 } | 791 } |
| 781 } | 792 } |
| 782 } | 793 } |
| 783 } | 794 } |
| 784 TestRunner testRunner; | 795 int threadCount = getThreadCount(); |
| 796 TestRunner testRunner(threadCount); |
| 785 for (int index = 0; index < state.fPixelWorst.count(); ++index) { | 797 for (int index = 0; index < state.fPixelWorst.count(); ++index) { |
| 786 const TestResult& result = state.fPixelWorst[index]; | 798 const TestResult& result = state.fPixelWorst[index]; |
| 787 SkString filename(result.fFilename); | 799 SkString filename(result.fFilename); |
| 788 if (!filename.endsWith(".skp")) { | 800 if (!filename.endsWith(".skp")) { |
| 789 filename.append(".skp"); | 801 filename.append(".skp"); |
| 790 } | 802 } |
| 791 *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableEncode, | 803 *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableEncode, |
| 792 (&testSkpClipEncode, result.fDirNo, filename.c_str(), &testRunne
r)); | 804 (&testSkpClipEncode, result.fDirNo, filename.c_str(), &testRunne
r)); |
| 793 } | 805 } |
| 794 testRunner.render(); | 806 testRunner.render(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 encodeFound(state); | 858 encodeFound(state); |
| 847 } | 859 } |
| 848 | 860 |
| 849 static void testSkpClipMain(TestState* data) { | 861 static void testSkpClipMain(TestState* data) { |
| 850 (void) doOneDir(data, true); | 862 (void) doOneDir(data, true); |
| 851 } | 863 } |
| 852 | 864 |
| 853 DEF_TEST(PathOpsSkpClipThreaded) { | 865 DEF_TEST(PathOpsSkpClipThreaded) { |
| 854 gDirs.setDefault(); | 866 gDirs.setDefault(); |
| 855 initTest(); | 867 initTest(); |
| 856 TestRunner testRunner; | 868 int threadCount = getThreadCount(); |
| 869 TestRunner testRunner(threadCount); |
| 857 int dirNo; | 870 int dirNo; |
| 858 gDirs.reset(); | 871 gDirs.reset(); |
| 859 while ((dirNo = gDirs.next()) > 0) { | 872 while ((dirNo = gDirs.next()) > 0) { |
| 860 *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableDir, | 873 *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableDir, |
| 861 (&testSkpClipMain, dirNo, &testRunner)); | 874 (&testSkpClipMain, dirNo, &testRunner)); |
| 862 } | 875 } |
| 863 testRunner.render(); | 876 testRunner.render(); |
| 864 TestState state; | 877 TestState state; |
| 865 state.init(0); | 878 state.init(0); |
| 866 gDirs.reset(); | 879 gDirs.reset(); |
| 867 while ((dirNo = gDirs.next()) > 0) { | 880 while ((dirNo = gDirs.next()) > 0) { |
| 868 TestState& testState = testRunner.fRunnables[dirNo - 1]->fState; | 881 TestState& testState = testRunner.fRunnables[dirNo - 1]->fState; |
| 869 SkASSERT(testState.fResult.fDirNo == dirNo); | 882 SkASSERT(testState.fResult.fDirNo == dirNo); |
| 870 for (int inner = 0; inner < testState.fPixelWorst.count(); ++inner) { | 883 for (int inner = 0; inner < testState.fPixelWorst.count(); ++inner) { |
| 871 addError(&state, testState.fPixelWorst[inner]); | 884 addError(&state, testState.fPixelWorst[inner]); |
| 872 } | 885 } |
| 873 for (int inner = 0; inner < testState.fSlowest.count(); ++inner) { | 886 for (int inner = 0; inner < testState.fSlowest.count(); ++inner) { |
| 874 addError(&state, testState.fSlowest[inner]); | 887 addError(&state, testState.fSlowest[inner]); |
| 875 } | 888 } |
| 876 } | 889 } |
| 877 encodeFound(state); | 890 encodeFound(state); |
| 878 } | 891 } |
| 879 | 892 |
| 880 static bool buildTests(SkTDArray<TestResult>* tests, SkTDArray<SortByName*>* sor
ted) { | 893 static bool buildTests(SkTDArray<TestResult>* tests, SkTDArray<SortByName*>* sor
ted) { |
| 881 int firstDirNo = gDirs.first(); | 894 int firstDirNo = gDirs.first(); |
| 882 int dirNo; | 895 int dirNo; |
| 883 while ((dirNo = gDirs.next()) > 0) { | 896 while ((dirNo = gDirs.next()) > 0) { |
| 884 if (!buildTestDir(dirNo, firstDirNo, tests, sorted)) { | 897 if (!buildTestDir(dirNo, firstDirNo, tests, sorted)) { |
| 885 return false; | 898 return false; |
| 886 } | 899 } |
| 887 } | 900 } |
| 888 return true; | 901 return true; |
| 889 } | 902 } |
| 890 | 903 |
| 891 DEF_TEST(PathOpsSkpClipUberThreaded) { | 904 DEF_TEST(PathOpsSkpClipUberThreaded) { |
| 892 gDirs.setDefault(); | 905 gDirs.setDefault(); |
| 893 const int firstDirNo = gDirs.next(); | 906 const int firstDirNo = gDirs.next(); |
| 894 const int lastDirNo = gDirs.last(); | 907 const int lastDirNo = gDirs.last(); |
| 895 initTest(); | 908 initTest(); |
| 896 int dirCount = lastDirNo - firstDirNo + 1; | 909 int dirCount = lastDirNo - firstDirNo + 1; |
| 897 SkAutoTDeleteArray<SkTDArray<TestResult> > tests(new SkTDArray<TestResult>[d
irCount]); | 910 SkAutoTDeleteArray<SkTDArray<TestResult> > tests(new SkTDArray<TestResult>[d
irCount]); |
| 898 SkAutoTDeleteArray<SkTDArray<SortByName*> > sorted(new SkTDArray<SortByName*
>[dirCount]); | 911 SkAutoTDeleteArray<SkTDArray<SortByName*> > sorted(new SkTDArray<SortByName*
>[dirCount]); |
| 899 if (!buildTests(tests.get(), sorted.get())) { | 912 if (!buildTests(tests.get(), sorted.get())) { |
| 900 return; | 913 return; |
| 901 } | 914 } |
| 902 TestRunner testRunner; | 915 int threadCount = getThreadCount(); |
| 916 TestRunner testRunner(threadCount); |
| 903 int dirNo; | 917 int dirNo; |
| 904 gDirs.reset(); | 918 gDirs.reset(); |
| 905 while ((dirNo = gDirs.next()) > 0) { | 919 while ((dirNo = gDirs.next()) > 0) { |
| 906 SkString dirName = get_in_path(dirNo, NULL); | 920 SkString dirName = get_in_path(dirNo, NULL); |
| 907 if (!dirName.size()) { | 921 if (!dirName.size()) { |
| 908 continue; | 922 continue; |
| 909 } | 923 } |
| 910 SkOSFile::Iter iter(dirName.c_str(), "skp"); | 924 SkOSFile::Iter iter(dirName.c_str(), "skp"); |
| 911 SkString filename; | 925 SkString filename; |
| 912 while (iter.next(&filename)) { | 926 while (iter.next(&filename)) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 } | 1110 } |
| 1097 SkGraphics::Term(); | 1111 SkGraphics::Term(); |
| 1098 return 0; | 1112 return 0; |
| 1099 } | 1113 } |
| 1100 | 1114 |
| 1101 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 1115 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 1102 int main(int argc, char * const argv[]) { | 1116 int main(int argc, char * const argv[]) { |
| 1103 return tool_main(argc, (char**) argv); | 1117 return tool_main(argc, (char**) argv); |
| 1104 } | 1118 } |
| 1105 #endif | 1119 #endif |
| OLD | NEW |