Remove SK_LEGACY_FONTMGR_FACTORY.
SkFontMgr factories now return sk_sp and the legacy factories are no
longer used and can be removed.
BUG=skia:5077
Change-Id: Ieaff8555b297d1db157f8b78cdd6e7d07a3b5490
Reviewed-on: https://skia-review.googlesource.com/6894
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index 18fc1d9..cd596eb 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -55,21 +55,6 @@
class FontMgrGM : public skiagm::GM {
public:
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- FontMgrGM(SkFontMgr* fontMgr = nullptr) {
- SkGraphics::SetFontCacheLimit(16 * 1024 * 1024);
-
- fName.set("fontmgr_iter");
- if (fontMgr) {
- fName.append("_factory");
- fFM.reset(fontMgr);
- } else {
- fFM.reset(SkFontMgr::RefDefault());
- }
- fName.append(sk_tool_utils::platform_os_name());
- fName.append(sk_tool_utils::platform_extra_config("GDI"));
- }
-#else
FontMgrGM(sk_sp<SkFontMgr> fontMgr = nullptr) {
SkGraphics::SetFontCacheLimit(16 * 1024 * 1024);
@@ -83,7 +68,6 @@
fName.append(sk_tool_utils::platform_os_name());
fName.append(sk_tool_utils::platform_extra_config("GDI"));
}
-#endif
protected:
SkString onShortName() override {
@@ -241,11 +225,7 @@
}
fName.append(sk_tool_utils::platform_os_name());
fName.append(sk_tool_utils::platform_extra_config("GDI"));
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- fFM.reset(SkFontMgr::RefDefault());
-#else
fFM = SkFontMgr::RefDefault();
-#endif
}
static void show_bounds(SkCanvas* canvas, const SkPaint& paint, SkScalar x, SkScalar y,
diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h
index a9317d3..4103e87 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -166,11 +166,7 @@
SkTypeface* legacyCreateTypeface(const char familyName[], SkFontStyle style) const;
/** Return the default fontmgr. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- static SkFontMgr* RefDefault();
-#else
static sk_sp<SkFontMgr> RefDefault();
-#endif
protected:
virtual int onCountFamilies() const = 0;
@@ -200,11 +196,7 @@
private:
/** Implemented by porting layer to return the default factory. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- static SkFontMgr* Factory();
-#else
static sk_sp<SkFontMgr> Factory();
-#endif
typedef SkRefCnt INHERITED;
};
diff --git a/include/ports/SkFontMgr_FontConfigInterface.h b/include/ports/SkFontMgr_FontConfigInterface.h
index 6cf34d0..9dccb7b 100644
--- a/include/ports/SkFontMgr_FontConfigInterface.h
+++ b/include/ports/SkFontMgr_FontConfigInterface.h
@@ -15,10 +15,6 @@
class SkFontConfigInterface;
/** Creates a SkFontMgr which wraps a SkFontConfigInterface. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci);
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci);
-#endif
#endif // #ifndef SkFontMgr_FontConfigInterface_DEFINED
diff --git a/include/ports/SkFontMgr_android.h b/include/ports/SkFontMgr_android.h
index ee73a4b..e1a8fec 100644
--- a/include/ports/SkFontMgr_android.h
+++ b/include/ports/SkFontMgr_android.h
@@ -40,10 +40,6 @@
};
/** Create a font manager for Android. If 'custom' is NULL, use only system fonts. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom);
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom);
-#endif
#endif // SkFontMgr_android_DEFINED
diff --git a/include/ports/SkFontMgr_custom.h b/include/ports/SkFontMgr_custom.h
index 9d3986d..d918763 100644
--- a/include/ports/SkFontMgr_custom.h
+++ b/include/ports/SkFontMgr_custom.h
@@ -13,17 +13,9 @@
class SkFontMgr;
/** Create a custom font manager which scans a given directory for font files. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_Custom_Directory(const char* dir);
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Directory(const char* dir);
-#endif
/** Create a custom font manager that contains no built-in fonts. */
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_Custom_Empty();
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Empty();
-#endif
#endif // SkFontMgr_custom_DEFINED
diff --git a/include/ports/SkFontMgr_fontconfig.h b/include/ports/SkFontMgr_fontconfig.h
index ed47982..75497cb 100644
--- a/include/ports/SkFontMgr_fontconfig.h
+++ b/include/ports/SkFontMgr_fontconfig.h
@@ -17,10 +17,6 @@
* If 'fc' is NULL, will use a new default config.
* Takes ownership of 'fc' and will call FcConfigDestroy on it.
*/
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc);
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
-#endif
#endif // #ifndef SkFontMgr_fontconfig_DEFINED
diff --git a/include/ports/SkTypeface_win.h b/include/ports/SkTypeface_win.h
index e332f00..06e7d33 100644
--- a/include/ports/SkTypeface_win.h
+++ b/include/ports/SkTypeface_win.h
@@ -44,30 +44,6 @@
struct IDWriteFontCollection;
struct IDWriteFontFallback;
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_GDI();
-SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory = NULL,
- IDWriteFontCollection* collection = NULL);
-SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
- IDWriteFontCollection* collection,
- IDWriteFontFallback* fallback);
-
-/**
- * Creates an SkFontMgr which renders using DirectWrite and obtains its data
- * from the SkRemotableFontMgr.
- *
- * If DirectWrite could not be initialized, will return NULL.
- */
-SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontMgr>);
-
-/**
- * Creates an SkRemotableFontMgr backed by DirectWrite using the default
- * system font collection in the current locale.
- *
- * If DirectWrite could not be initialized, will return NULL.
- */
-SK_API SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite();
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_GDI();
SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory = NULL,
IDWriteFontCollection* collection = NULL);
@@ -90,7 +66,6 @@
* If DirectWrite could not be initialized, will return NULL.
*/
SK_API sk_sp<SkRemotableFontMgr> SkRemotableFontMgr_New_DirectWrite();
-#endif
#endif // SK_BUILD_FOR_WIN
#endif // SkTypeface_win_DEFINED
diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp
index b9865a2..03ac2eb 100644
--- a/src/core/SkFontMgr.cpp
+++ b/src/core/SkFontMgr.cpp
@@ -167,18 +167,6 @@
return this->onLegacyCreateTypeface(familyName, style);
}
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::RefDefault() {
- static SkOnce once;
- static SkFontMgr* singleton;
-
- once([]{
- SkFontMgr* fm = SkFontMgr::Factory();
- singleton = fm ? fm : new SkEmptyFontMgr;
- });
- return SkRef(singleton);
-}
-#else
sk_sp<SkFontMgr> SkFontMgr::RefDefault() {
static SkOnce once;
static sk_sp<SkFontMgr> singleton;
@@ -189,7 +177,6 @@
});
return singleton;
}
-#endif
/**
* Width has the greatest priority.
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index ce48954..3e3887b 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -2380,10 +2380,6 @@
///////////////////////////////////////////////////////////////////////////////
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; }
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() { return sk_make_sp<SkFontMgr_Mac>(); }
-#endif
#endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 9caff02..e6e0715 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -2487,10 +2487,6 @@
///////////////////////////////////////////////////////////////////////////////
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; }
-#else
sk_sp<SkFontMgr> SkFontMgr_New_GDI() { return sk_make_sp<SkFontMgrGDI>(); }
-#endif
#endif//defined(SK_BUILD_FOR_WIN32)
diff --git a/src/ports/SkFontMgr_FontConfigInterface.cpp b/src/ports/SkFontMgr_FontConfigInterface.cpp
index 201306c..f5e3ef0 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -296,14 +296,7 @@
}
};
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci) {
- SkASSERT(fci);
- return new SkFontMgr_FCI(std::move(fci));
-}
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_FCI(sk_sp<SkFontConfigInterface> fci) {
SkASSERT(fci);
return sk_make_sp<SkFontMgr_FCI>(std::move(fci));
}
-#endif
diff --git a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp b/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
index 2aa617c..a4ee138 100644
--- a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
@@ -9,11 +9,7 @@
#include "SkFontMgr.h"
#include "SkFontMgr_FontConfigInterface.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
sk_sp<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal());
if (!fci) {
return nullptr;
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index fe4a82d..d4d7967 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -535,11 +535,8 @@
"OnlyCustom", "PreferCustom", "PreferSystem"
};
#endif
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom) {
-#else
+
sk_sp<SkFontMgr> SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom) {
-#endif
if (custom) {
SkASSERT(0 <= custom->fSystemFontUse);
SkASSERT(custom->fSystemFontUse < SK_ARRAY_COUNT(gSystemFontUseStrings));
@@ -549,9 +546,5 @@
custom->fFontsXml,
custom->fFallbackFontsXml));
}
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- return new SkFontMgr_Android(custom);
-#else
return sk_make_sp<SkFontMgr_Android>(custom);
-#endif
}
diff --git a/src/ports/SkFontMgr_android_factory.cpp b/src/ports/SkFontMgr_android_factory.cpp
index 281b5b8..88e0558 100644
--- a/src/ports/SkFontMgr_android_factory.cpp
+++ b/src/ports/SkFontMgr_android_factory.cpp
@@ -10,11 +10,7 @@
#include "SkFontMgr.h"
#include "SkFontMgr_android.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_Android(nullptr);
}
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 5cfdb08..1b6baa1 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -420,15 +420,9 @@
SkString fBaseDirectory;
};
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_Custom_Directory(const char* dir) {
- return new SkFontMgr_Custom(DirectorySystemFontLoader(dir));
-}
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Directory(const char* dir) {
return sk_make_sp<SkFontMgr_Custom>(DirectorySystemFontLoader(dir));
}
-#endif
///////////////////////////////////////////////////////////////////////////////
@@ -504,15 +498,9 @@
const SkEmbeddedResourceHeader* fHeader;
};
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr_New_Custom_Embedded(const SkEmbeddedResourceHeader* header) {
- return new SkFontMgr_Custom(EmbeddedSystemFontLoader(header));
-}
-#else
sk_sp<SkFontMgr> SkFontMgr_New_Custom_Embedded(const SkEmbeddedResourceHeader* header) {
return sk_make_sp<SkFontMgr_Custom>(EmbeddedSystemFontLoader(header));
}
-#endif
///////////////////////////////////////////////////////////////////////////////
@@ -530,12 +518,6 @@
};
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_Custom_Empty() {
- return new SkFontMgr_Custom(EmptyFontLoader());
-}
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Empty() {
return sk_make_sp<SkFontMgr_Custom>(EmptyFontLoader());
}
-#endif
diff --git a/src/ports/SkFontMgr_custom_directory_factory.cpp b/src/ports/SkFontMgr_custom_directory_factory.cpp
index 5cf6d3c..7ed4711 100644
--- a/src/ports/SkFontMgr_custom_directory_factory.cpp
+++ b/src/ports/SkFontMgr_custom_directory_factory.cpp
@@ -12,10 +12,6 @@
# define SK_FONT_FILE_PREFIX "/usr/share/fonts/"
#endif
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_Custom_Directory(SK_FONT_FILE_PREFIX);
}
diff --git a/src/ports/SkFontMgr_custom_embedded_factory.cpp b/src/ports/SkFontMgr_custom_embedded_factory.cpp
index 79d5500..7a6df43 100644
--- a/src/ports/SkFontMgr_custom_embedded_factory.cpp
+++ b/src/ports/SkFontMgr_custom_embedded_factory.cpp
@@ -9,17 +9,9 @@
struct SkEmbeddedResource { const uint8_t* data; size_t size; };
struct SkEmbeddedResourceHeader { const SkEmbeddedResource* entries; int count; };
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr_New_Custom_Embedded(const SkEmbeddedResourceHeader* header);
-#else
sk_sp<SkFontMgr> SkFontMgr_New_Custom_Embedded(const SkEmbeddedResourceHeader* header);
-#endif
extern "C" const SkEmbeddedResourceHeader SK_EMBEDDED_FONTS;
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_Custom_Embedded(&SK_EMBEDDED_FONTS);
}
diff --git a/src/ports/SkFontMgr_custom_empty_factory.cpp b/src/ports/SkFontMgr_custom_empty_factory.cpp
index c95647e..bc988f4 100644
--- a/src/ports/SkFontMgr_custom_empty_factory.cpp
+++ b/src/ports/SkFontMgr_custom_empty_factory.cpp
@@ -8,10 +8,6 @@
#include "SkFontMgr.h"
#include "SkFontMgr_custom.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_Custom_Empty();
}
diff --git a/src/ports/SkFontMgr_empty_factory.cpp b/src/ports/SkFontMgr_empty_factory.cpp
index b01811a..9ca9e65 100644
--- a/src/ports/SkFontMgr_empty_factory.cpp
+++ b/src/ports/SkFontMgr_empty_factory.cpp
@@ -7,11 +7,7 @@
#include "SkFontMgr.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
// Always return nullptr, an empty SkFontMgr will be used.
return nullptr;
}
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 28edcf7..0fe352a 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -953,12 +953,6 @@
}
};
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) {
- return new SkFontMgr_fontconfig(fc);
-}
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
return sk_make_sp<SkFontMgr_fontconfig>(fc);
}
-#endif
diff --git a/src/ports/SkFontMgr_fontconfig_factory.cpp b/src/ports/SkFontMgr_fontconfig_factory.cpp
index 1a86ed5..2f5ffb4 100644
--- a/src/ports/SkFontMgr_fontconfig_factory.cpp
+++ b/src/ports/SkFontMgr_fontconfig_factory.cpp
@@ -9,10 +9,6 @@
#include "SkFontMgr_fontconfig.h"
#include "SkTypes.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_FontConfig(nullptr);
}
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index 29069f0..905f413 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -1043,22 +1043,14 @@
////////////////////////////////////////////////////////////////////////////////
#include "SkTypeface_win.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
-#endif
- IDWriteFontCollection* collection) {
+ IDWriteFontCollection* collection) {
return SkFontMgr_New_DirectWrite(factory, collection, nullptr);
}
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
-#endif
- IDWriteFontCollection* collection,
- IDWriteFontFallback* fallback) {
+ IDWriteFontCollection* collection,
+ IDWriteFontFallback* fallback) {
if (nullptr == factory) {
factory = sk_get_dwrite_factory();
if (nullptr == factory) {
@@ -1089,28 +1081,16 @@
};
}
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- return new SkFontMgr_DirectWrite(factory, collection, fallback, localeName, localeNameLen);
-#else
return sk_make_sp<SkFontMgr_DirectWrite>(factory, collection, fallback,
localeName, localeNameLen);
-#endif
}
#include "SkFontMgr_indirect.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontMgr> proxy) {
-#else
SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontMgr> proxy) {
-#endif
sk_sp<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
if (!impl) {
return nullptr;
}
-#ifdef SK_LEGACY_FONTMGR_FACTORY
- return new SkFontMgr_Indirect(std::move(impl), std::move(proxy));
-#else
return sk_make_sp<SkFontMgr_Indirect>(std::move(impl), std::move(proxy));
-#endif
}
#endif//defined(SK_BUILD_FOR_WIN32)
diff --git a/src/ports/SkFontMgr_win_dw_factory.cpp b/src/ports/SkFontMgr_win_dw_factory.cpp
index 01a0e0b..464a05b 100644
--- a/src/ports/SkFontMgr_win_dw_factory.cpp
+++ b/src/ports/SkFontMgr_win_dw_factory.cpp
@@ -11,11 +11,7 @@
#include "SkFontMgr.h"
#include "SkTypeface_win.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_DirectWrite();
}
diff --git a/src/ports/SkFontMgr_win_gdi_factory.cpp b/src/ports/SkFontMgr_win_gdi_factory.cpp
index 040778e..6015794 100644
--- a/src/ports/SkFontMgr_win_gdi_factory.cpp
+++ b/src/ports/SkFontMgr_win_gdi_factory.cpp
@@ -11,11 +11,7 @@
#include "SkFontMgr.h"
#include "SkTypeface_win.h"
-#ifdef SK_LEGACY_FONTMGR_FACTORY
-SkFontMgr* SkFontMgr::Factory() {
-#else
sk_sp<SkFontMgr> SkFontMgr::Factory() {
-#endif
return SkFontMgr_New_GDI();
}