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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P
REFIX) - 1)) { | 1244 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P
REFIX) - 1)) { |
1245 return sk_tool_utils::create_portable_typeface(familyName, style); | 1245 return sk_tool_utils::create_portable_typeface(familyName, style); |
1246 } | 1246 } |
1247 return nullptr; | 1247 return nullptr; |
1248 } | 1248 } |
1249 | 1249 |
1250 #undef PORTABLE_FONT_PREFIX | 1250 #undef PORTABLE_FONT_PREFIX |
1251 | 1251 |
1252 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkFontStyle )
; | 1252 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkFontStyle )
; |
1253 | 1253 |
1254 extern bool gDefaultProfileIsSRGB; | |
1255 | |
1256 int dm_main(); | 1254 int dm_main(); |
1257 int dm_main() { | 1255 int dm_main() { |
1258 setbuf(stdout, nullptr); | 1256 setbuf(stdout, nullptr); |
1259 setup_crash_handler(); | 1257 setup_crash_handler(); |
1260 | 1258 |
1261 if (FLAGS_verbose) { | 1259 if (FLAGS_verbose) { |
1262 gVLog = stderr; | 1260 gVLog = stderr; |
1263 } else if (!FLAGS_writePath.isEmpty()) { | 1261 } else if (!FLAGS_writePath.isEmpty()) { |
1264 sk_mkdir(FLAGS_writePath[0]); | 1262 sk_mkdir(FLAGS_writePath[0]); |
1265 gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(
), "w", stderr); | 1263 gVLog = freopen(SkOSPath::Join(FLAGS_writePath[0], "verbose.log").c_str(
), "w", stderr); |
1266 } | 1264 } |
1267 | 1265 |
1268 if (FLAGS_forceSRGB) { | |
1269 gDefaultProfileIsSRGB = true; | |
1270 } | |
1271 | |
1272 JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never
missing. | 1266 JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never
missing. |
1273 SkAutoGraphics ag; | 1267 SkAutoGraphics ag; |
1274 SkTaskGroup::Enabler enabled(FLAGS_threads); | 1268 SkTaskGroup::Enabler enabled(FLAGS_threads); |
1275 gCreateTypefaceDelegate = &create_from_name; | 1269 gCreateTypefaceDelegate = &create_from_name; |
1276 | 1270 |
1277 { | 1271 { |
1278 SkString testResourcePath = GetResourcePath("color_wheel.png"); | 1272 SkString testResourcePath = GetResourcePath("color_wheel.png"); |
1279 SkFILEStream testResource(testResourcePath.c_str()); | 1273 SkFILEStream testResource(testResourcePath.c_str()); |
1280 if (!testResource.isValid()) { | 1274 if (!testResource.isValid()) { |
1281 info("Some resources are missing. Do you need to set --resourcePath
?\n"); | 1275 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... |
1409 #endif | 1403 #endif |
1410 } | 1404 } |
1411 } // namespace skiatest | 1405 } // namespace skiatest |
1412 | 1406 |
1413 #if !defined(SK_BUILD_FOR_IOS) | 1407 #if !defined(SK_BUILD_FOR_IOS) |
1414 int main(int argc, char** argv) { | 1408 int main(int argc, char** argv) { |
1415 SkCommandLineFlags::Parse(argc, argv); | 1409 SkCommandLineFlags::Parse(argc, argv); |
1416 return dm_main(); | 1410 return dm_main(); |
1417 } | 1411 } |
1418 #endif | 1412 #endif |
OLD | NEW |