aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2017-01-11 13:54:39 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-11 19:50:14 +0000
commit20d031a6ad7853eec166a4a648c09b12e4f32008 (patch)
tree0bb75cd2b3e1e18e87641894123308f609d6f606
parentd50fd8c18989fd4209dbfe40d24e5060c04f6d8c (diff)
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>
-rw-r--r--gm/fontmgr.cpp20
-rw-r--r--include/ports/SkFontMgr.h8
-rw-r--r--include/ports/SkFontMgr_FontConfigInterface.h4
-rw-r--r--include/ports/SkFontMgr_android.h4
-rw-r--r--include/ports/SkFontMgr_custom.h8
-rw-r--r--include/ports/SkFontMgr_fontconfig.h4
-rw-r--r--include/ports/SkTypeface_win.h25
-rw-r--r--src/core/SkFontMgr.cpp13
-rw-r--r--src/ports/SkFontHost_mac.cpp4
-rw-r--r--src/ports/SkFontHost_win.cpp4
-rw-r--r--src/ports/SkFontMgr_FontConfigInterface.cpp7
-rw-r--r--src/ports/SkFontMgr_FontConfigInterface_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_android.cpp9
-rw-r--r--src/ports/SkFontMgr_android_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_custom.cpp18
-rw-r--r--src/ports/SkFontMgr_custom_directory_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_custom_embedded_factory.cpp8
-rw-r--r--src/ports/SkFontMgr_custom_empty_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_empty_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_fontconfig.cpp6
-rw-r--r--src/ports/SkFontMgr_fontconfig_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_win_dw.cpp26
-rw-r--r--src/ports/SkFontMgr_win_dw_factory.cpp4
-rw-r--r--src/ports/SkFontMgr_win_gdi_factory.cpp4
24 files changed, 4 insertions, 196 deletions
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index 18fc1d9250..cd596ebac7 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -55,21 +55,6 @@ static const char* ja = "ja";
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 @@ public:
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 @@ public:
}
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 a9317d31e4..4103e8747e 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -166,11 +166,7 @@ public:
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 @@ protected:
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 6cf34d013c..9dccb7bed7 100644
--- a/include/ports/SkFontMgr_FontConfigInterface.h
+++ b/include/ports/SkFontMgr_FontConfigInterface.h
@@ -15,10 +15,6 @@ class SkFontMgr;
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 ee73a4b717..e1a8fecb97 100644
--- a/include/ports/SkFontMgr_android.h
+++ b/include/ports/SkFontMgr_android.h
@@ -40,10 +40,6 @@ struct SkFontMgr_Android_CustomFonts {
};
/** 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 9d3986d161..d918763493 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 ed479828ea..75497cbdc7 100644
--- a/include/ports/SkFontMgr_fontconfig.h
+++ b/include/ports/SkFontMgr_fontconfig.h
@@ -17,10 +17,6 @@ class SkFontMgr;
* 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 e332f00b72..06e7d33b59 100644
--- a/include/ports/SkTypeface_win.h
+++ b/include/ports/SkTypeface_win.h
@@ -44,30 +44,6 @@ struct IDWriteFactory;
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 @@ SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontM
* 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 b9865a2597..03ac2eba83 100644
--- a/src/core/SkFontMgr.cpp
+++ b/src/core/SkFontMgr.cpp
@@ -167,18 +167,6 @@ SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[], SkFontStyle
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 @@ sk_sp<SkFontMgr> SkFontMgr::RefDefault() {
});
return singleton;
}
-#endif
/**
* Width has the greatest priority.
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index ce4895419f..3e3887b4a7 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -2380,10 +2380,6 @@ protected:
///////////////////////////////////////////////////////////////////////////////
-#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 9caff02b54..e6e07159c4 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -2487,10 +2487,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
-#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 201306c805..f5e3ef0e05 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -296,14 +296,7 @@ protected:
}
};
-#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 2aa617c757..a4ee13841a 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 fe4a82d964..d4d7967dc5 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -535,11 +535,8 @@ static char const * const gSystemFontUseStrings[] = {
"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 @@ sk_sp<SkFontMgr> SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* cust
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 281b5b8bb5..88e055840b 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 5cfdb081d6..1b6baa19a4 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -420,15 +420,9 @@ private:
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 @@ private:
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 @@ public:
};
-#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 5cf6d3cb04..7ed47118e4 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 79d5500648..7a6df43b73 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 c95647ef24..bc988f48c9 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 b01811a335..9ca9e65fdd 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 28edcf790b..0fe352a9cd 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -953,12 +953,6 @@ protected:
}
};
-#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 1a86ed5323..2f5ffb41ac 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 29069f069e..905f413693 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -1043,22 +1043,14 @@ SkTypeface* SkFontStyleSet_DirectWrite::matchStyle(const SkFontStyle& pattern) {
////////////////////////////////////////////////////////////////////////////////
#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 @@ SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWrite(IDWriteFactory* factory,
};
}
-#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 01a0e0be8a..464a05b43f 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 040778e174..6015794bbc 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();
}