Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: dm/DM.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 sleep(FLAGS_status_sec); 1274 sleep(FLAGS_status_sec);
1275 #endif 1275 #endif
1276 } 1276 }
1277 }); 1277 });
1278 thread->start(); 1278 thread->start();
1279 return thread; 1279 return thread;
1280 } 1280 }
1281 1281
1282 #define PORTABLE_FONT_PREFIX "Toy Liberation " 1282 #define PORTABLE_FONT_PREFIX "Toy Liberation "
1283 1283
1284 static SkTypeface* create_from_name(const char familyName[], SkTypeface::Style s tyle) { 1284 static sk_sp<SkTypeface> create_from_name(const char familyName[], SkTypeface::S tyle style) {
1285 if (familyName && strlen(familyName) > sizeof(PORTABLE_FONT_PREFIX) 1285 if (familyName && strlen(familyName) > sizeof(PORTABLE_FONT_PREFIX)
1286 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P REFIX) - 1)) { 1286 && !strncmp(familyName, PORTABLE_FONT_PREFIX, sizeof(PORTABLE_FONT_P REFIX) - 1)) {
1287 return sk_tool_utils::create_portable_typeface(familyName, style); 1287 return sk_tool_utils::create_portable_typeface(familyName, style);
1288 } 1288 }
1289 return nullptr; 1289 return nullptr;
1290 } 1290 }
1291 1291
1292 #undef PORTABLE_FONT_PREFIX 1292 #undef PORTABLE_FONT_PREFIX
1293 1293
1294 extern SkTypeface* (*gCreateTypefaceDelegate)(const char [], SkTypeface::Style ) ; 1294 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkTypeface::S tyle );
1295 1295
1296 int dm_main(); 1296 int dm_main();
1297 int dm_main() { 1297 int dm_main() {
1298 setbuf(stdout, nullptr); 1298 setbuf(stdout, nullptr);
1299 setup_crash_handler(); 1299 setup_crash_handler();
1300 1300
1301 if (FLAGS_verbose) { 1301 if (FLAGS_verbose) {
1302 gVLog = stderr; 1302 gVLog = stderr;
1303 } else if (!FLAGS_writePath.isEmpty()) { 1303 } else if (!FLAGS_writePath.isEmpty()) {
1304 sk_mkdir(FLAGS_writePath[0]); 1304 sk_mkdir(FLAGS_writePath[0]);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 #endif 1443 #endif
1444 } 1444 }
1445 } // namespace skiatest 1445 } // namespace skiatest
1446 1446
1447 #if !defined(SK_BUILD_FOR_IOS) 1447 #if !defined(SK_BUILD_FOR_IOS)
1448 int main(int argc, char** argv) { 1448 int main(int argc, char** argv) {
1449 SkCommandLineFlags::Parse(argc, argv); 1449 SkCommandLineFlags::Parse(argc, argv);
1450 return dm_main(); 1450 return dm_main();
1451 } 1451 }
1452 #endif 1452 #endif
OLDNEW
« no previous file with comments | « bench/TextBlobBench.cpp ('k') | fuzz/FilterFuzz.cpp » ('j') | gm/colortype.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698