diff options
author | Mike Reed <reed@google.com> | 2019-01-31 16:50:52 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2019-01-31 22:18:12 +0000 |
commit | 88c6eb5c545b4fb1b9d7e963d561edda80707742 (patch) | |
tree | 54526b7869d71717239054b5a9aa919b434e5650 /src | |
parent | 3105238ed5fba23632239d32b8f04d793fc8478f (diff) | |
download | skqp-88c6eb5c545b4fb1b9d7e963d561edda80707742.tar.gz |
remove (dead) legacy measuretext
Bug: skia:
Change-Id: I3deed21a9e4a019f87557f751fafdcc36c95fa57
Reviewed-on: https://skia-review.googlesource.com/c/188312
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkFont.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/core/SkFont.cpp b/src/core/SkFont.cpp index c9f8e5041b..ac745ab2f4 100644 --- a/src/core/SkFont.cpp +++ b/src/core/SkFont.cpp @@ -321,53 +321,6 @@ static void join_bounds_x(const SkGlyph& g, SkRect* bounds, SkScalar dx) { SkIntToScalar(g.fTop + g.fHeight)); } -SkScalar SkFont::legacy_measureText(const void* textD, size_t length, SkTextEncoding encoding, - SkRect* bounds, const SkPaint* paint) const { - if (length == 0) { - if (bounds) { - bounds->setEmpty(); - } - return 0; - } - - SkCanonicalizeFont canon(*this, paint); - const SkFont& font = canon.getFont(); - SkScalar scale = canon.getScale(); - - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(font, canon.getPaint()); - - const char* text = static_cast<const char*>(textD); - const char* stop = text + length; - auto glyphCacheProc = SkFontPriv::GetGlyphCacheProc(encoding, nullptr != bounds); - const SkGlyph* g = &glyphCacheProc(cache.get(), &text, stop); - SkScalar width = g->fAdvanceX; - - if (nullptr == bounds) { - while (text < stop) { - width += glyphCacheProc(cache.get(), &text, stop).fAdvanceX; - } - } else { - set_bounds(*g, bounds); - while (text < stop) { - g = &glyphCacheProc(cache.get(), &text, stop); - join_bounds_x(*g, bounds, width); - width += g->fAdvanceX; - } - } - SkASSERT(text == stop); - - if (scale) { - width *= scale; - if (bounds) { - bounds->fLeft *= scale; - bounds->fTop *= scale; - bounds->fRight *= scale; - bounds->fBottom *= scale; - } - } - return width; -} - SkScalar SkFont::measureText(const void* text, size_t length, SkTextEncoding encoding, SkRect* bounds, const SkPaint* paint) const { SkCanonicalizeFont canon(*this, paint); @@ -412,16 +365,6 @@ SkScalar SkFont::measureText(const void* text, size_t length, SkTextEncoding enc } } -#ifdef SK_DEBUG - { - SkRect b2; - SkScalar w2 = this->legacy_measureText(text, length, encoding, &b2, paint); - SkASSERT(width == w2); - if (bounds) { - SkASSERT(*bounds == b2); - } - } -#endif return width; } |