| 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 "DMSrcSinkAndroid.h" | 4 #include "DMSrcSinkAndroid.h" |
| 5 #include "OverwriteLine.h" | 5 #include "OverwriteLine.h" |
| 6 #include "ProcStats.h" | 6 #include "ProcStats.h" |
| 7 #include "SkBBHFactory.h" | 7 #include "SkBBHFactory.h" |
| 8 #include "SkChecksum.h" | 8 #include "SkChecksum.h" |
| 9 #include "SkCommonFlags.h" | 9 #include "SkCommonFlags.h" |
| 10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| 11 #include "SkGraphics.h" | 11 #include "SkGraphics.h" |
| 12 #include "SkInstCnt.h" | 12 #include "SkInstCnt.h" |
| 13 #include "SkMD5.h" | 13 #include "SkMD5.h" |
| 14 #include "SkOSFile.h" | 14 #include "SkOSFile.h" |
| 15 #include "SkTHash.h" | 15 #include "SkTHash.h" |
| 16 #include "SkTaskGroup.h" | 16 #include "SkTaskGroup.h" |
| 17 #include "SkThreadUtils.h" | 17 #include "SkThreadUtils.h" |
| 18 #include "Test.h" | 18 #include "Test.h" |
| 19 #include "Timer.h" | 19 #include "Timer.h" |
| 20 | 20 |
| 21 DEFINE_string(src, "tests gm skp image subset codec", "Source types to test."); | 21 DEFINE_string(src, "tests gm skp image subset codec scanline", "Source types to
test."); |
| 22 DEFINE_bool(nameByHash, false, | 22 DEFINE_bool(nameByHash, false, |
| 23 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " | 23 "If true, write to FLAGS_writePath[0]/<hash>.png instead of " |
| 24 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); | 24 "to FLAGS_writePath[0]/<config>/<sourceType>/<name>.png"); |
| 25 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); | 25 DEFINE_bool2(pathOpsExtended, x, false, "Run extended pathOps tests."); |
| 26 DEFINE_string(matrix, "1 0 0 1", | 26 DEFINE_string(matrix, "1 0 0 1", |
| 27 "2x2 scale+skew matrix to apply or upright when using " | 27 "2x2 scale+skew matrix to apply or upright when using " |
| 28 "'matrix' or 'upright' in config."); | 28 "'matrix' or 'upright' in config."); |
| 29 DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?"); | 29 DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?"); |
| 30 | 30 |
| 31 DEFINE_string(blacklist, "", | 31 DEFINE_string(blacklist, "", |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 for (int i = 0; i < FLAGS_images.count(); i++) { | 171 for (int i = 0; i < FLAGS_images.count(); i++) { |
| 172 const char* flag = FLAGS_images[i]; | 172 const char* flag = FLAGS_images[i]; |
| 173 if (sk_isdir(flag)) { | 173 if (sk_isdir(flag)) { |
| 174 for (size_t j = 0; j < SK_ARRAY_COUNT(exts); j++) { | 174 for (size_t j = 0; j < SK_ARRAY_COUNT(exts); j++) { |
| 175 SkOSFile::Iter it(flag, exts[j]); | 175 SkOSFile::Iter it(flag, exts[j]); |
| 176 for (SkString file; it.next(&file); ) { | 176 for (SkString file; it.next(&file); ) { |
| 177 SkString path = SkOSPath::Join(flag, file.c_str()); | 177 SkString path = SkOSPath::Join(flag, file.c_str()); |
| 178 push_src("image", new ImageSrc(path)); // Decode entire
image. | 178 push_src("image", new ImageSrc(path)); // Decode entire
image. |
| 179 push_src("subset", new ImageSrc(path, 2)); // Decode into 2
x 2 subsets | 179 push_src("subset", new ImageSrc(path, 2)); // Decode into 2
x 2 subsets |
| 180 if (codec_supported(exts[j])) { | 180 if (codec_supported(exts[j])) { |
| 181 push_src("codec", new CodecSrc(path)); // Decode wit
h SkCodec. | 181 push_src("codec", new CodecSrc(path, CodecSrc::kNormal_M
ode)); |
| 182 push_src("scanline", new CodecSrc(path, CodecSrc::kScanl
ine_Mode)); |
| 182 } | 183 } |
| 183 } | 184 } |
| 184 } | 185 } |
| 185 } else if (sk_exists(flag)) { | 186 } else if (sk_exists(flag)) { |
| 186 // assume that FLAGS_images[i] is a valid image if it is a file. | 187 // assume that FLAGS_images[i] is a valid image if it is a file. |
| 187 push_src("image", new ImageSrc(flag)); // Decode entire image. | 188 push_src("image", new ImageSrc(flag)); // Decode entire image. |
| 188 push_src("subset", new ImageSrc(flag, 2)); // Decode into 2 x 2 subs
ets | 189 push_src("subset", new ImageSrc(flag, 2)); // Decode into 2 x 2 subs
ets |
| 189 push_src("codec", new CodecSrc(flag)); // Decode with SkCodec. | 190 push_src("codec", new CodecSrc(flag, CodecSrc::kNormal_Mode)); |
| 191 push_src("scanline", new CodecSrc(flag, CodecSrc::kScanline_Mode)); |
| 190 } | 192 } |
| 191 } | 193 } |
| 192 } | 194 } |
| 193 | 195 |
| 194 static GrGLStandard get_gpu_api() { | 196 static GrGLStandard get_gpu_api() { |
| 195 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; } | 197 if (FLAGS_gpuAPI.contains("gl")) { return kGL_GrGLStandard; } |
| 196 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; } | 198 if (FLAGS_gpuAPI.contains("gles")) { return kGLES_GrGLStandard; } |
| 197 return kNone_GrGLStandard; | 199 return kNone_GrGLStandard; |
| 198 } | 200 } |
| 199 | 201 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 } | 639 } |
| 638 return 0; | 640 return 0; |
| 639 } | 641 } |
| 640 | 642 |
| 641 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 643 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 642 int main(int argc, char** argv) { | 644 int main(int argc, char** argv) { |
| 643 SkCommandLineFlags::Parse(argc, argv); | 645 SkCommandLineFlags::Parse(argc, argv); |
| 644 return dm_main(); | 646 return dm_main(); |
| 645 } | 647 } |
| 646 #endif | 648 #endif |
| OLD | NEW |