| OLD | NEW |
| 1 #include "CrashHandler.h" | 1 #include "CrashHandler.h" |
| 2 #include "DMJsonWriter.h" | 2 #include "DMJsonWriter.h" |
| 3 #include "DMSrcSink.h" | 3 #include "DMSrcSink.h" |
| 4 #include "OverwriteLine.h" | 4 #include "OverwriteLine.h" |
| 5 #include "ProcStats.h" | 5 #include "ProcStats.h" |
| 6 #include "SkBBHFactory.h" | 6 #include "SkBBHFactory.h" |
| 7 #include "SkChecksum.h" | 7 #include "SkChecksum.h" |
| 8 #include "SkCommonFlags.h" | 8 #include "SkCommonFlags.h" |
| 9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| 11 #include "SkMD5.h" | 11 #include "SkMD5.h" |
| 12 #include "SkOSFile.h" | 12 #include "SkOSFile.h" |
| 13 #include "SkTDynamicHash.h" | 13 #include "SkTDynamicHash.h" |
| 14 #include "SkTaskGroup.h" | 14 #include "SkTaskGroup.h" |
| 15 #include "Test.h" | 15 #include "Test.h" |
| 16 #include "Timer.h" | 16 #include "Timer.h" |
| 17 | 17 |
| 18 DEFINE_string(images, "resources", "Images to decode."); | 18 DEFINE_string(images, "resources", "Images to decode."); |
| 19 DEFINE_string(src, "tests gm skp image", "Source types to test."); | 19 DEFINE_string(src, "tests gm skp image subset", "Source types to test."); |
| 20 DEFINE_bool(nameByHash, false, | 20 DEFINE_bool(nameByHash, false, |
| 21 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " | 21 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " |
| 22 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); | 22 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); |
| 23 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); | 23 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); |
| 24 DEFINE_string(matrix, "1 0 0 0 1 0 0 0 1", | 24 DEFINE_string(matrix, "1 0 0 0 1 0 0 0 1", |
| 25 "Matrix to apply when using 'matrix' in config."); | 25 "Matrix to apply when using 'matrix' in config."); |
| 26 DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?"); | 26 DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?"); |
| 27 | 27 |
| 28 DEFINE_string(blacklist, "", | 28 DEFINE_string(blacklist, "", |
| 29 "Space-separated config/src/name triples to blacklist. '_' matches anyt
hing. E.g. \n" | 29 "Space-separated config/src/name triples to blacklist. '_' matches anyt
hing. E.g. \n" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 "BMP", "GIF", "JPG", "JPEG", "PNG", "WEBP", "KTX", "ASTC", "WBMP", "ICO"
, | 138 "BMP", "GIF", "JPG", "JPEG", "PNG", "WEBP", "KTX", "ASTC", "WBMP", "ICO"
, |
| 139 }; | 139 }; |
| 140 for (int i = 0; i < FLAGS_images.count(); i++) { | 140 for (int i = 0; i < FLAGS_images.count(); i++) { |
| 141 const char* flag = FLAGS_images[i]; | 141 const char* flag = FLAGS_images[i]; |
| 142 if (sk_isdir(flag)) { | 142 if (sk_isdir(flag)) { |
| 143 for (size_t j = 0; j < SK_ARRAY_COUNT(exts); j++) { | 143 for (size_t j = 0; j < SK_ARRAY_COUNT(exts); j++) { |
| 144 SkOSFile::Iter it(flag, exts[j]); | 144 SkOSFile::Iter it(flag, exts[j]); |
| 145 for (SkString file; it.next(&file); ) { | 145 for (SkString file; it.next(&file); ) { |
| 146 SkString path = SkOSPath::Join(flag, file.c_str()); | 146 SkString path = SkOSPath::Join(flag, file.c_str()); |
| 147 push_src("image", new ImageSrc(path)); // Decode entire
image. | 147 push_src("image", new ImageSrc(path)); // Decode entire
image. |
| 148 push_src("image", new ImageSrc(path, 5)); // Decode 5 rando
m subsets. | 148 push_src("subset", new ImageSrc(path, 2)); // Decode into 2
x 2 subsets |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } else if (sk_exists(flag)) { | 151 } else if (sk_exists(flag)) { |
| 152 // assume that FLAGS_images[i] is a valid image if it is a file. | 152 // assume that FLAGS_images[i] is a valid image if it is a file. |
| 153 push_src("image", new ImageSrc(flag)); // Decode entire image. | 153 push_src("image", new ImageSrc(flag)); // Decode entire image. |
| 154 push_src("image", new ImageSrc(flag, 5)); // Decode 5 random subset
s. | 154 push_src("subset", new ImageSrc(flag, 2)); // Decode into 2 x 2 subs
ets |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 static GrGLStandard get_gpu_api() { | 159 static GrGLStandard get_gpu_api() { |
| 160 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; } | 160 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; } |
| 161 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; } | 161 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; } |
| 162 return kNone_GrGLStandard; | 162 return kNone_GrGLStandard; |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 } | 544 } |
| 545 return 0; | 545 return 0; |
| 546 } | 546 } |
| 547 | 547 |
| 548 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 548 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 549 int main(int argc, char** argv) { | 549 int main(int argc, char** argv) { |
| 550 SkCommandLineFlags::Parse(argc, argv); | 550 SkCommandLineFlags::Parse(argc, argv); |
| 551 return dm_main(); | 551 return dm_main(); |
| 552 } | 552 } |
| 553 #endif | 553 #endif |
| OLD | NEW |