aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
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 /src/ports
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>
Diffstat (limited to 'src/ports')
-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
16 files changed, 4 insertions, 110 deletions
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();
}