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