create a wrapper to manage --nativeFonts and --gdi
Put it in ToolUtils to avoid cyclic dependencies.
Change-Id: Ie0ad7eb5d1ba58be5ad8c668afdb7c74facd71dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203181
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index fe9fef6..6cad26e 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -20,7 +20,6 @@
#include "SampleSlide.h"
#include "SkCanvas.h"
#include "SkColorSpacePriv.h"
-#include "SkFontMgrPriv.h"
#include "SkGraphics.h"
#include "SkImagePriv.h"
#include "SkJSONWriter.h"
@@ -36,7 +35,7 @@
#include "SkTo.h"
#include "SlideDir.h"
#include "SvgSlide.h"
-#include "TestFontMgr.h"
+#include "ToolUtils.h"
#include "ccpr/GrCoverageCountingPathRenderer.h"
#include <stdlib.h>
@@ -245,9 +244,7 @@
SetResourcePath("/data/local/tmp/resources");
#endif
- if (!FLAGS_nativeFonts) {
- gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
- }
+ ToolUtils::SetDefaultFontMgr();
initializeEventTracingForTools();
static SkTaskGroup::Enabler kTaskGroupEnabler(FLAGS_threads);