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