remove (unused and weird) zoom parameter on getFontMetrics

Bug: skia:
Change-Id: I17d1d79da7518aaa37daf22768f1b2624bd59bcf
Reviewed-on: https://skia-review.googlesource.com/c/167540
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-11-01 16:57:26 -04:00 committed by Skia Commit-Bot
parent 99d0a28920
commit 67510d3a7d
2 changed files with 4 additions and 13 deletions

View File

@ -1091,14 +1091,11 @@ public:
Results are scaled by text size but does not take into account
dimensions required by text scale x, text skew x, fake bold,
style stroke, and SkPathEffect.
Results can be additionally scaled by scale; a scale of zero
is ignored.
@param metrics storage for SkPaint::FontMetrics from SkTypeface; may be nullptr
@param scale additional multiplier for returned values
@return recommended spacing between lines
*/
SkScalar getFontMetrics(FontMetrics* metrics, SkScalar scale = 0) const;
SkScalar getFontMetrics(FontMetrics* metrics) const;
/** Returns the recommended spacing between lines: the sum of metrics
descent, ascent, and leading.
@ -1108,7 +1105,7 @@ public:
@return recommended spacing between lines
*/
SkScalar getFontSpacing() const { return this->getFontMetrics(nullptr, 0); }
SkScalar getFontSpacing() const { return this->getFontMetrics(nullptr); }
/** Converts text into glyph indices.
Returns the number of glyph indices represented by text.

View File

@ -472,17 +472,11 @@ size_t SkPaint::breakText(const void* textD, size_t length, SkScalar maxWidth,
///////////////////////////////////////////////////////////////////////////////
SkScalar SkPaint::getFontMetrics(FontMetrics* metrics, SkScalar zoom) const {
SkScalar SkPaint::getFontMetrics(FontMetrics* metrics) const {
SkCanonicalizePaint canon(*this);
const SkPaint& paint = canon.getPaint();
SkScalar scale = canon.getScale();
SkMatrix zoomMatrix, *zoomPtr = nullptr;
if (zoom) {
zoomMatrix.setScale(zoom, zoom);
zoomPtr = &zoomMatrix;
}
FontMetrics storage;
if (nullptr == metrics) {
metrics = &storage;
@ -492,7 +486,7 @@ SkScalar SkPaint::getFontMetrics(FontMetrics* metrics, SkScalar zoom) const {
SkScalerContextEffects effects;
auto desc = SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
paint, nullptr, SkScalerContextFlags::kNone, zoomPtr, &ad, &effects);
paint, nullptr, SkScalerContextFlags::kNone, nullptr, &ad, &effects);
{
auto typeface = SkPaintPriv::GetTypefaceOrDefault(paint);