aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
17 files changed, 4 insertions, 123 deletions
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();
}