remove dead code around SK_SUPPORT_LEGACY_FONT_FLAGS

Bug: skia:
Change-Id: I5a36e6827610c2a429e2f8b36adf432b95993c54
Reviewed-on: https://skia-review.googlesource.com/c/171529
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-11-16 12:40:04 -05:00 committed by Skia Commit-Bot
parent 449cb53bd8
commit 3b155a77c3
2 changed files with 0 additions and 90 deletions

View File

@ -18,29 +18,6 @@ struct SkFontMetrics;
class SK_API SkFont {
public:
#ifdef SK_SUPPORT_LEGACY_FONT_FLAGS
enum Flags {
/**
* Use the system's automatic hinting mechanism to hint the typeface.
*/
kForceAutoHinting_Flag = 1 << 0,
/**
* If the typeface contains explicit bitmaps for hinting, use them.
* If both bytecode and auto hints are also specified, attempt to use the bitmaps first;
* if that fails (e.g. there are no bitmaps), then attempt to bytecode or autohint.
*/
kEmbeddedBitmaps_Flag = 1 << 1,
kSubpixel_Flag = 1 << 2,
kLinearMetrics_Flag = 1 << 3,
kEmbolden_Flag = 1 << 4,
kDEPRECATED_Antialias_Flag = 1 << 5,
kDEPRECATED_LCDRender_Flag = 1 << 6,
};
#endif
enum class Edging {
kAlias,
kAntiAlias,
@ -57,10 +34,6 @@ public:
SkFont();
SkFont(sk_sp<SkTypeface>, SkScalar size);
SkFont(sk_sp<SkTypeface>, SkScalar size, SkScalar scaleX, SkScalar skewX);
#ifdef SK_SUPPORT_LEGACY_FONT_FLAGS
SkFont(sk_sp<SkTypeface>, SkScalar size, uint32_t flags);
SkFont(sk_sp<SkTypeface>, SkScalar size, SkScalar scaleX, SkScalar skewX, uint32_t flags);
#endif
bool isForceAutoHinting() const { return SkToBool(fFlags & kForceAutoHinting_PrivFlag); }
bool isEmbeddedBitmaps() const { return SkToBool(fFlags & kEmbeddedBitmaps_PrivFlag); }
@ -94,21 +67,6 @@ public:
*/
SkFont makeWithSize(SkScalar size) const;
#ifdef SK_SUPPORT_LEGACY_FONT_FLAGS
bool DEPRECATED_isAntiAlias() const { return SkToBool(fFlags & kDEPRECATED_Antialias_Flag); }
bool DEPRECATED_isLCDRender() const { return SkToBool(fFlags & kDEPRECATED_LCDRender_Flag); }
void DEPRECATED_setAntiAlias(bool);
void DEPRECATED_setLCDRender(bool);
/**
* Return a font with the same attributes of this font, but with the flags.
*/
SkFont makeWithFlags(uint32_t newFlags) const;
uint32_t getFlags() const { return fFlags; }
void setFlags(uint32_t);
#endif
SkTypeface* getTypeface() const { return fTypeface.get(); }
SkScalar getSize() const { return fSize; }
SkScalar getScaleX() const { return fScaleX; }

View File

@ -40,18 +40,6 @@ SkFont::SkFont(sk_sp<SkTypeface> face, SkScalar size) : SkFont(std::move(face),
SkFont::SkFont() : SkFont(nullptr, kDefault_Size) {}
#ifdef SK_SUPPORT_LEGACY_FONT_FLAGS
SkFont::SkFont(sk_sp<SkTypeface> face, SkScalar size, SkScalar scaleX, SkScalar skewX,
uint32_t legacy_flags) : SkFont(std::move(face), size, scaleX, skewX) {
this->setFlags(legacy_flags);
}
SkFont::SkFont(sk_sp<SkTypeface> face, SkScalar size, uint32_t legacy_flags)
: SkFont(std::move(face), size) {
this->setFlags(legacy_flags);
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
static inline uint32_t set_clear_mask(uint32_t bits, bool cond, uint32_t mask) {
@ -74,42 +62,6 @@ void SkFont::setEmbolden(bool predicate) {
fFlags = set_clear_mask(fFlags, predicate, kEmbolden_PrivFlag);
}
#ifdef SK_SUPPORT_LEGACY_FONT_FLAGS
void SkFont::DEPRECATED_setAntiAlias(bool doAA) {
if (!doAA) {
this->setEdging(Edging::kAlias);
} else {
if (this->getEdging() == Edging::kAlias) {
this->setEdging(Edging::kAntiAlias);
}
// else leave the current fEdging as is
}
}
void SkFont::DEPRECATED_setLCDRender(bool doLCD) {
if (doLCD) {
this->setEdging(Edging::kSubpixelAntiAlias);
} else {
if (this->getEdging() == Edging::kSubpixelAntiAlias) {
this->setEdging(Edging::kAntiAlias);
}
// else leave the current fEdging as is
}
}
void SkFont::setFlags(uint32_t legacy_flags) {
fFlags = legacy_flags & 0x1F; // the first 5 flags are fine
this->DEPRECATED_setAntiAlias(SkToBool(legacy_flags & kDEPRECATED_Antialias_Flag));
this->DEPRECATED_setLCDRender(SkToBool(legacy_flags & kDEPRECATED_LCDRender_Flag));
}
SkFont SkFont::makeWithFlags(uint32_t newFlags) const {
SkFont font = *this;
font.setFlags(newFlags);
return font;
}
#endif
void SkFont::setEdging(Edging e) {
fEdging = SkToU8(e);
}