Remove SK_IGNORE_LINEAR_METRICS_FIX.

No users are defining this macro any more, so it should now be safe to
remove. With this change 'linearMetrics' now means 'normal metrics' if
false and 'unhinted metrics' if true.

Change-Id: I32916a7b0fc291feff7ab8cd6d68bb58847337f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213135
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2019-05-10 11:58:16 -04:00 committed by Skia Commit-Bot
parent 303bacbc0f
commit 603e09bdb8
2 changed files with 2 additions and 24 deletions

View File

@ -113,11 +113,7 @@ SkFont SkFont::makeWithSize(SkScalar newSize) const {
///////////////////////////////////////////////////////////////////////////////////////////////////
SkScalar SkFont::setupForAsPaths(SkPaint* paint) {
constexpr uint32_t flagsToIgnore =
#ifdef SK_IGNORE_LINEAR_METRICS_FIX
kLinearMetrics_PrivFlag |
#endif
kEmbeddedBitmaps_PrivFlag |
constexpr uint32_t flagsToIgnore = kEmbeddedBitmaps_PrivFlag |
kForceAutoHinting_PrivFlag;
fFlags = (fFlags & ~flagsToIgnore) | kSubpixel_PrivFlag;
@ -148,11 +144,7 @@ public:
if (paint) {
fPaint = *paint;
}
if (
#ifdef SK_IGNORE_LINEAR_METRICS_FIX
font.isLinearMetrics() ||
#endif
SkDraw::ShouldDrawTextAsPaths(font, fPaint, SkMatrix::I())) {
if (SkDraw::ShouldDrawTextAsPaths(font, fPaint, SkMatrix::I())) {
SkFont* f = fLazyFont.set(font);
fScale = f->setupForAsPaths(nullptr);
fFont = f;

View File

@ -1025,27 +1025,13 @@ void SkScalerContext::MakeRecAndEffects(const SkFont& font, const SkPaint& paint
if (font.isForceAutoHinting()) {
flags |= SkScalerContext::kForceAutohinting_Flag;
}
#ifdef SK_IGNORE_LINEAR_METRICS_FIX
if (font.isSubpixel()) {
#else
if (font.isLinearMetrics()) {
#endif
flags |= SkScalerContext::kLinearMetrics_Flag;
}
rec->fFlags = SkToU16(flags);
#ifdef SK_IGNORE_LINEAR_METRICS_FIX
// if linear-text is on, then we force hinting to be off (since that's sort of
// the point of linear-text.
SkFontHinting hinting = (SkFontHinting)font.getHinting();
if (font.isLinearMetrics()) {
hinting = SkFontHinting::kNone;
}
rec->setHinting(font.getHinting());
#else
// these modify fFlags, so do them after assigning fFlags
rec->setHinting(font.getHinting());
#endif
rec->setLuminanceColor(SkPaintPriv::ComputeLuminanceColor(paint));
// For now always set the paint gamma equal to the device gamma.