| 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" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 DEFINE_string2(readPath, r, "", "If set check for equality with golden results i
n this directory."); | 65 DEFINE_string2(readPath, r, "", "If set check for equality with golden results i
n this directory."); |
| 66 | 66 |
| 67 DEFINE_string(uninterestingHashesFile, "", | 67 DEFINE_string(uninterestingHashesFile, "", |
| 68 "File containing a list of uninteresting hashes. If a result hashes to s
omething in " | 68 "File containing a list of uninteresting hashes. If a result hashes to s
omething in " |
| 69 "this list, no image is written for that result."); | 69 "this list, no image is written for that result."); |
| 70 | 70 |
| 71 DEFINE_int32(shards, 1, "We're splitting source data into this many shards."); | 71 DEFINE_int32(shards, 1, "We're splitting source data into this many shards."); |
| 72 DEFINE_int32(shard, 0, "Which shard do I run?"); | 72 DEFINE_int32(shard, 0, "Which shard do I run?"); |
| 73 DEFINE_bool(simpleCodec, false, "Only decode images to native scale"); | 73 DEFINE_bool(simpleCodec, false, "Only decode images to native scale"); |
| 74 DEFINE_bool(forceSRGB, false, "Force SRGB for imageinfos"); |
| 74 | 75 |
| 75 using namespace DM; | 76 using namespace DM; |
| 76 using sk_gpu_test::GrContextFactory; | 77 using sk_gpu_test::GrContextFactory; |
| 77 using sk_gpu_test::GLTestContext; | 78 using sk_gpu_test::GLTestContext; |
| 78 using sk_gpu_test::ContextInfo; | 79 using sk_gpu_test::ContextInfo; |
| 79 | 80 |
| 80 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 81 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 81 | 82 |
| 82 static const double kStartMs = SkTime::GetMSecs(); | 83 static const double kStartMs = SkTime::GetMSecs(); |
| 83 | 84 |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P
REFIX) - 1)) { | 1225 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P
REFIX) - 1)) { |
| 1225 return sk_tool_utils::create_portable_typeface(familyName, style); | 1226 return sk_tool_utils::create_portable_typeface(familyName, style); |
| 1226 } | 1227 } |
| 1227 return nullptr; | 1228 return nullptr; |
| 1228 } | 1229 } |
| 1229 | 1230 |
| 1230 #undef PORTABLE_FONT_PREFIX | 1231 #undef PORTABLE_FONT_PREFIX |
| 1231 | 1232 |
| 1232 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkTypeface::S
tyle ); | 1233 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkTypeface::S
tyle ); |
| 1233 | 1234 |
| 1235 extern bool gDefaultProfileIsSRGB; |
| 1236 |
| 1234 int dm_main(); | 1237 int dm_main(); |
| 1235 int dm_main() { | 1238 int dm_main() { |
| 1236 setbuf(stdout, nullptr); | 1239 setbuf(stdout, nullptr); |
| 1237 setup_crash_handler(); | 1240 setup_crash_handler(); |
| 1238 | 1241 |
| 1239 if (FLAGS_verbose) { | 1242 if (FLAGS_verbose) { |
| 1240 gVLog = stderr; | 1243 gVLog = stderr; |
| 1241 } else if (!FLAGS_writePath.isEmpty()) { | 1244 } else if (!FLAGS_writePath.isEmpty()) { |
| 1242 sk_mkdir(FLAGS_writePath[0]); | 1245 sk_mkdir(FLAGS_writePath[0]); |
| 1243 gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(
), "w", stderr); | 1246 gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(
), "w", stderr); |
| 1244 } | 1247 } |
| 1245 | 1248 |
| 1249 if (FLAGS_forceSRGB) { |
| 1250 gDefaultProfileIsSRGB = true; |
| 1251 } |
| 1252 |
| 1246 JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never
missing. | 1253 JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never
missing. |
| 1247 SkAutoGraphics ag; | 1254 SkAutoGraphics ag; |
| 1248 SkTaskGroup::Enabler enabled(FLAGS_threads); | 1255 SkTaskGroup::Enabler enabled(FLAGS_threads); |
| 1249 gCreateTypefaceDelegate = &create_from_name; | 1256 gCreateTypefaceDelegate = &create_from_name; |
| 1250 | 1257 |
| 1251 { | 1258 { |
| 1252 SkString testResourcePath = GetResourcePath("color_wheel.png"); | 1259 SkString testResourcePath = GetResourcePath("color_wheel.png"); |
| 1253 SkFILEStream testResource(testResourcePath.c_str()); | 1260 SkFILEStream testResource(testResourcePath.c_str()); |
| 1254 if (!testResource.isValid()) { | 1261 if (!testResource.isValid()) { |
| 1255 info("Some resources are missing. Do you need to set --resourcePath
?\n"); | 1262 info("Some resources are missing. Do you need to set --resourcePath
?\n"); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 #endif | 1390 #endif |
| 1384 } | 1391 } |
| 1385 } // namespace skiatest | 1392 } // namespace skiatest |
| 1386 | 1393 |
| 1387 #if !defined(SK_BUILD_FOR_IOS) | 1394 #if !defined(SK_BUILD_FOR_IOS) |
| 1388 int main(int argc, char** argv) { | 1395 int main(int argc, char** argv) { |
| 1389 SkCommandLineFlags::Parse(argc, argv); | 1396 SkCommandLineFlags::Parse(argc, argv); |
| 1390 return dm_main(); | 1397 return dm_main(); |
| 1391 } | 1398 } |
| 1392 #endif | 1399 #endif |
| OLD | NEW |