aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-04-13 05:23:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-13 05:23:35 -0700
commited2edabd07086bbf60df17ca0bf52d8ba49f2273 (patch)
treed14257caf9d2775bcff4132eb8195d68a7d07576
parentdada4dd9cf03e42369ca5b38086dba77f01a68e6 (diff)
Remove SK_VERY_LEGACY_CREATE_TYPEFACE.
The flag and code it guards are no longer used. TBR=reed This just removes dead code. Review URL: https://codereview.chromium.org/1882803002
-rw-r--r--gm/fontmgr.cpp4
-rw-r--r--include/ports/SkFontConfigInterface.h8
-rw-r--r--include/ports/SkFontMgr.h9
-rw-r--r--include/ports/SkFontMgr_indirect.h4
-rw-r--r--src/core/SkFontMgr.cpp8
-rw-r--r--src/core/SkTypeface.cpp8
-rw-r--r--src/fonts/SkFontMgr_fontconfig.cpp5
-rw-r--r--src/fonts/SkFontMgr_indirect.cpp6
-rw-r--r--src/ports/SkFontConfigInterface_direct.cpp58
-rw-r--r--src/ports/SkFontConfigInterface_direct.h8
-rw-r--r--src/ports/SkFontConfigTypeface.h4
-rw-r--r--src/ports/SkFontHost_fontconfig.cpp18
-rw-r--r--src/ports/SkFontHost_mac.cpp5
-rw-r--r--src/ports/SkFontHost_win.cpp5
-rw-r--r--src/ports/SkFontMgr_android.cpp5
-rw-r--r--src/ports/SkFontMgr_custom.cpp5
-rw-r--r--src/ports/SkFontMgr_fontconfig.cpp5
-rw-r--r--src/ports/SkFontMgr_win_dw.cpp10
-rw-r--r--tools/sk_tool_utils_font.cpp4
19 files changed, 1 insertions, 178 deletions
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index ee3805c29f..efd01c5ca9 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -45,11 +45,7 @@ static SkScalar drawCharacter(SkCanvas* canvas, uint32_t character, SkScalar x,
// it expects to get the same glyph when following this pattern.
SkString familyName;
typeface->getFamilyName(&familyName);
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* typefaceCopy = fm->legacyCreateTypeface(familyName.c_str(), typeface->style());
-#else
SkTypeface* typefaceCopy = fm->legacyCreateTypeface(familyName.c_str(), typeface->fontStyle());
-#endif
SkSafeUnref(paint.setTypeface(typefaceCopy));
return drawString(canvas, ch, x, y, paint) + 20;
}
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index 464251bc2d..3c68a242e5 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -80,19 +80,11 @@ public:
*
* If a match is not found, return false, and ignore all out parameters.
*/
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- virtual bool matchFamilyName(const char familyName[],
- SkTypeface::Style requested,
- FontIdentity* outFontIdentifier,
- SkString* outFamilyName,
- SkTypeface::Style* outStyle) = 0;
-#else
virtual bool matchFamilyName(const char familyName[],
SkFontStyle requested,
FontIdentity* outFontIdentifier,
SkString* outFamilyName,
SkFontStyle* outStyle) = 0;
-#endif
/**
* Given a FontRef, open a stream to access its data, or return null
diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h
index a961cd48ad..ad6ed545d9 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -164,11 +164,7 @@ public:
*/
SkTypeface* createFromFile(const char path[], int ttcIndex = 0) const;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* legacyCreateTypeface(const char familyName[], unsigned typefaceStyleBits) const;
-#else
SkTypeface* legacyCreateTypeface(const char familyName[], SkFontStyle style) const;
-#endif
/**
* Return a ref to the default fontmgr. The caller must call unref() on
@@ -199,12 +195,7 @@ protected:
virtual SkTypeface* onCreateFromFontData(SkFontData*) const;
virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const = 0;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
- unsigned styleBits) const = 0;
-#else
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const = 0;
-#endif
private:
static SkFontMgr* Factory(); // implemented by porting layer
diff --git a/include/ports/SkFontMgr_indirect.h b/include/ports/SkFontMgr_indirect.h
index b3f31c3b8e..5e8f1ede70 100644
--- a/include/ports/SkFontMgr_indirect.h
+++ b/include/ports/SkFontMgr_indirect.h
@@ -54,11 +54,7 @@ protected:
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override;
SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override;
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const override;
-#endif
private:
SkTypeface* createTypefaceFromFontId(const SkFontIdentity& fontId) const;
diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp
index 68a6c2406f..eba2b28fd6 100644
--- a/src/core/SkFontMgr.cpp
+++ b/src/core/SkFontMgr.cpp
@@ -74,11 +74,7 @@ protected:
SkTypeface* onCreateFromFile(const char[], int) const override {
return nullptr;
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char [], unsigned) const override {
-#else
SkTypeface* onLegacyCreateTypeface(const char [], SkFontStyle) const override {
-#endif
return nullptr;
}
};
@@ -169,11 +165,7 @@ SkTypeface* SkFontMgr::createFromFile(const char path[], int ttcIndex) const {
return this->onCreateFromFile(path, ttcIndex);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[], unsigned style) const {
-#else
SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[], SkFontStyle style) const {
-#endif
return this->onLegacyCreateTypeface(familyName, style);
}
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index f9e5b5f43b..07b1467360 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -87,11 +87,7 @@ SkTypeface* SkTypeface::GetDefaultTypeface(Style style) {
SkAutoMutexAcquire lock(&gCreateDefaultMutex);
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* t = fm->legacyCreateTypeface(nullptr, style);
-#else
SkTypeface* t = fm->legacyCreateTypeface(nullptr, SkFontStyle::FromOldStyle(style));
-#endif
return t ? t : SkEmptyTypeface::Create();
});
}
@@ -124,11 +120,7 @@ SkTypeface* SkTypeface::CreateFromName(const char name[], Style style) {
return RefDefault(style);
}
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- return fm->legacyCreateTypeface(name, style);
-#else
return fm->legacyCreateTypeface(name, SkFontStyle::FromOldStyle(style));
-#endif
}
SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp
index 60ad862a50..fedd3dc533 100644
--- a/src/fonts/SkFontMgr_fontconfig.cpp
+++ b/src/fonts/SkFontMgr_fontconfig.cpp
@@ -318,12 +318,7 @@ protected:
return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr;
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkTypeface::Style style = static_cast<SkTypeface::Style>(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
FCLocker lock;
return FontConfigTypeface::LegacyCreateTypeface(familyName, style);
}
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp
index 4d226da855..d3fae91808 100644
--- a/src/fonts/SkFontMgr_indirect.cpp
+++ b/src/fonts/SkFontMgr_indirect.cpp
@@ -184,14 +184,8 @@ SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con
return fImpl->createFromData(data, ttcIndex);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
- unsigned styleBits) const {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
SkFontStyle style) const {
-#endif
SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style));
if (nullptr == face.get()) {
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index 1c42e2d37e..cc80fbe647 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -305,40 +305,6 @@ bool IsFallbackFontAllowed(const SkString& family) {
}
// Retrieves |is_bold|, |is_italic| and |font_family| properties from |font|.
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-SkTypeface::Style GetFontStyle(FcPattern* font) {
- int resulting_bold;
- if (FcPatternGetInteger(font, FC_WEIGHT, 0, &resulting_bold))
- resulting_bold = FC_WEIGHT_NORMAL;
-
- int resulting_italic;
- if (FcPatternGetInteger(font, FC_SLANT, 0, &resulting_italic))
- resulting_italic = FC_SLANT_ROMAN;
-
- // If we ask for an italic font, fontconfig might take a roman font and set
- // the undocumented property FC_MATRIX to a skew matrix. It'll then say
- // that the font is italic or oblique. So, if we see a matrix, we don't
- // believe that it's italic.
- FcValue matrix;
- const bool have_matrix = FcPatternGet(font, FC_MATRIX, 0, &matrix) == 0;
-
- // If we ask for an italic font, fontconfig might take a roman font and set
- // FC_EMBOLDEN.
- FcValue embolden;
- const bool have_embolden = FcPatternGet(font, FC_EMBOLDEN, 0, &embolden) == 0;
-
- int styleBits = 0;
- if (resulting_bold > FC_WEIGHT_MEDIUM && !have_embolden) {
- styleBits |= SkTypeface::kBold;
- }
- if (resulting_italic > FC_SLANT_ROMAN && !have_matrix) {
- styleBits |= SkTypeface::kItalic;
- }
-
- return (SkTypeface::Style)styleBits;
-}
-#else
-
static int get_int(FcPattern* pattern, const char object[], int missing) {
int value;
if (FcPatternGetInteger(pattern, object, 0, &value) != FcResultMatch) {
@@ -463,11 +429,6 @@ static void fcpattern_from_skfontstyle(SkFontStyle style, FcPattern* pattern) {
FcPatternAddInteger(pattern, FC_SLANT, style.isItalic() ? FC_SLANT_ITALIC : FC_SLANT_ROMAN);
}
-SkFontStyle GetFontStyle(FcPattern* font) {
- return skfontstyle_from_fcpattern(font);
-}
-#endif
-
} // anonymous namespace
///////////////////////////////////////////////////////////////////////////////
@@ -549,19 +510,11 @@ FcPattern* SkFontConfigInterfaceDirect::MatchFont(FcFontSet* font_set,
return match;
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
- SkTypeface::Style style,
- FontIdentity* outIdentity,
- SkString* outFamilyName,
- SkTypeface::Style* outStyle) {
-#else
bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
SkFontStyle style,
FontIdentity* outIdentity,
SkString* outFamilyName,
SkFontStyle* outStyle) {
-#endif
SkString familyStr(familyName ? familyName : "");
if (familyStr.size() > kMaxFontFamilyLength) {
return false;
@@ -574,16 +527,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
if (familyName) {
FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)familyName);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- FcPatternAddInteger(pattern, FC_WEIGHT,
- (style & SkTypeface::kBold) ? FC_WEIGHT_BOLD
- : FC_WEIGHT_NORMAL);
- FcPatternAddInteger(pattern, FC_SLANT,
- (style & SkTypeface::kItalic) ? FC_SLANT_ITALIC
- : FC_SLANT_ROMAN);
-#else
fcpattern_from_skfontstyle(style, pattern);
-#endif
FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
@@ -671,7 +615,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[],
outFamilyName->set(post_config_family);
}
if (outStyle) {
- *outStyle = GetFontStyle(match);
+ *outStyle = skfontstyle_from_fcpattern(match);
}
return true;
}
diff --git a/src/ports/SkFontConfigInterface_direct.h b/src/ports/SkFontConfigInterface_direct.h
index 22dd9f1994..3f0af82699 100644
--- a/src/ports/SkFontConfigInterface_direct.h
+++ b/src/ports/SkFontConfigInterface_direct.h
@@ -17,20 +17,12 @@ public:
SkFontConfigInterfaceDirect();
~SkFontConfigInterfaceDirect() override;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- bool matchFamilyName(const char familyName[],
- SkTypeface::Style requested,
- FontIdentity* outFontIdentifier,
- SkString* outFamilyName,
- SkTypeface::Style* outStyle) override;
-#else
bool matchFamilyName(const char familyName[],
SkFontStyle requested,
FontIdentity* outFontIdentifier,
SkString* outFamilyName,
SkFontStyle* outStyle) override;
-#endif
SkStreamAsset* openStream(const FontIdentity&) override;
// new APIs
diff --git a/src/ports/SkFontConfigTypeface.h b/src/ports/SkFontConfigTypeface.h
index 68a36e35e1..00e00cf2ed 100644
--- a/src/ports/SkFontConfigTypeface.h
+++ b/src/ports/SkFontConfigTypeface.h
@@ -39,11 +39,7 @@ public:
return fFamilyName.equals(name);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- static SkTypeface* LegacyCreateTypeface(const char familyName[], SkTypeface::Style);
-#else
static SkTypeface* LegacyCreateTypeface(const char familyName[], SkFontStyle);
-#endif
protected:
FontConfigTypeface(const SkFontStyle& style,
diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp
index 207aa72323..0ed8d8fa3e 100644
--- a/src/ports/SkFontHost_fontconfig.cpp
+++ b/src/ports/SkFontHost_fontconfig.cpp
@@ -166,16 +166,9 @@ public:
}
};
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-SkTypeface* FontConfigTypeface::LegacyCreateTypeface(const char requestedFamilyName[],
- SkTypeface::Style requestedOldStyle)
-{
- SkFontStyle requestedStyle = SkFontStyle::FromOldStyle(requestedOldStyle);
-#else
SkTypeface* FontConfigTypeface::LegacyCreateTypeface(const char requestedFamilyName[],
SkFontStyle requestedStyle)
{
-#endif
SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
if (nullptr == fci.get()) {
return nullptr;
@@ -191,13 +184,8 @@ SkTypeface* FontConfigTypeface::LegacyCreateTypeface(const char requestedFamilyN
SkFontConfigInterface::FontIdentity identity;
SkString outFamilyName;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface::Style outStyle;
- if (!fci->matchFamilyName(requestedFamilyName, requestedOldStyle,
-#else
SkFontStyle outStyle;
if (!fci->matchFamilyName(requestedFamilyName, requestedStyle,
-#endif
&identity, &outFamilyName, &outStyle))
{
return nullptr;
@@ -206,15 +194,9 @@ SkTypeface* FontConfigTypeface::LegacyCreateTypeface(const char requestedFamilyN
// Check if a typeface with this FontIdentity is already in the FontIdentity cache.
face = SkTypefaceCache::FindByProcAndRef(find_by_FontIdentity, &identity);
if (!face) {
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- face = FontConfigTypeface::Create(SkFontStyle::FromOldStyle(outStyle), identity, outFamilyName);
- // Add this FontIdentity to the FontIdentity cache.
- SkTypefaceCache::Add(face, SkFontStyle::FromOldStyle(outStyle));
-#else
face = FontConfigTypeface::Create(outStyle, identity, outFamilyName);
// Add this FontIdentity to the FontIdentity cache.
SkTypefaceCache::Add(face, outStyle);
-#endif
}
// Add this request to the request cache.
SkFontHostRequestCache::Add(face, request.release());
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 70693ee144..049d08b6fc 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -2559,12 +2559,7 @@ protected:
return create_from_dataProvider(pr);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
if (familyName) {
familyName = map_css_names(familyName);
}
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 9ded4f5f53..c9781ba23a 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -2501,12 +2501,7 @@ protected:
return this->createFromStream(SkStream::NewFromFile(path));
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
LOGFONT lf;
if (nullptr == familyName) {
lf = get_default_font();
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 741d6cc173..ed5a4d53a7 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -487,12 +487,7 @@ protected:
return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
if (familyName) {
// On Android, we must return nullptr when we can't find the requested
// named typeface so that the system/app can provide their own recovery
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 6749ced350..20d6f78f7e 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -308,12 +308,7 @@ protected:
return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr;
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
SkTypeface* tf = nullptr;
if (familyName) {
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index c8b055f779..393265c542 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -874,12 +874,7 @@ protected:
return new SkTypeface_stream(fontData, style, isFixedWidth);
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
-#endif
SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, style));
if (typeface.get()) {
return typeface.release();
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index 788bb5edd3..a03fcf8d42 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -294,11 +294,7 @@ protected:
SkTypeface* onCreateFromStream(SkStreamAsset* stream, int ttcIndex) const override;
SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override;
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override;
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override;
-#else
SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle) const override;
-#endif
private:
HRESULT getByFamilyName(const WCHAR familyName[], IDWriteFontFamily** fontFamily) const;
@@ -953,14 +949,8 @@ HRESULT SkFontMgr_DirectWrite::getDefaultFontFamily(IDWriteFontFamily** fontFami
return S_OK;
}
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
-SkTypeface* SkFontMgr_DirectWrite::onLegacyCreateTypeface(const char familyName[],
- unsigned styleBits) const {
- SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
-#else
SkTypeface* SkFontMgr_DirectWrite::onLegacyCreateTypeface(const char familyName[],
SkFontStyle style) const {
-#endif
SkTScopedComPtr<IDWriteFontFamily> fontFamily;
if (familyName) {
SkSMallocWCHAR wideFamilyName;
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index df47926548..adbfa1692b 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -47,11 +47,7 @@ SkTypeface* create_font(const char* name, SkTypeface::Style style) {
// If we called SkTypeface::CreateFromName() here we'd recurse infinitely,
// so we reimplement its core logic here inline without the recursive aspect.
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
-#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
- return fm->legacyCreateTypeface(name, style);
-#else
return fm->legacyCreateTypeface(name, SkFontStyle::FromOldStyle(style));
-#endif
}
} else {
sub = &gSubFonts[gDefaultFontIndex];