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

Unified Diff: tools/sk_tool_utils_font.cpp

Issue 1163283002: update portable fonts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update font creation code Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: tools/sk_tool_utils_font.cpp
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index 7cee944b5250d70d8d5e09bc8fd9097e396fff8b..70da87f82be7752dbe7edc91309fe3d925168587 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -6,6 +6,7 @@
*/
#include "Resources.h"
+#include "SkFontMgr.h"
#include "SkOSFile.h"
#include "SkTestScalerContext.h"
#include "SkThread.h"
@@ -14,7 +15,10 @@
namespace sk_tool_utils {
-#include "test_font_data.cpp"
+#include "test_font_monospace.cpp"
+#include "test_font_sans_serif.cpp"
+#include "test_font_serif.cpp"
+#include "test_font_index.cpp"
static void release_portable_typefaces() {
// We'll clean this up in our own tests, but disable for clients.
@@ -44,7 +48,8 @@ SkTypeface* create_font(const char* name, SkTypeface::Style style) {
}
if (!fontData) {
SkDebugf("missing %s %d\n", name, style);
mtklein 2015/06/09 14:39:49 Should we consider just crashing here instead?
caryclark 2015/06/09 16:37:21 Let's defer the crash until after old tests have b
- return SkTypeface::CreateFromName(name, style);
+ SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
mtklein 2015/06/09 14:39:48 Is this something like // If we called SkTypeface
caryclark 2015/06/09 16:37:21 Done.
+ return fm->legacyCreateTypeface(name, style);
}
} else {
sub = &gSubFonts[gDefaultFontIndex];

Powered by Google App Engine
This is Rietveld 408576698