Cache should work with INF values
Change-Id: I1ae8d95bb85d28fdce9e0cf270583f0224e4dfed
Bug: skia:9874
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268938
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/modules/skparagraph/src/TextStyle.cpp b/modules/skparagraph/src/TextStyle.cpp
index e3d645c..d4ce181 100644
--- a/modules/skparagraph/src/TextStyle.cpp
+++ b/modules/skparagraph/src/TextStyle.cpp
@@ -108,10 +108,10 @@
fFontStyle == that.fFontStyle &&
fFontFamilies == that.fFontFamilies &&
fFontFeatures == that.fFontFeatures &&
- SkScalarNearlyEqual(fLetterSpacing, that.fLetterSpacing) &&
- SkScalarNearlyEqual(fWordSpacing, that.fWordSpacing) &&
- SkScalarNearlyEqual(fHeight, that.fHeight) &&
- SkScalarNearlyEqual(fFontSize, that.fFontSize) &&
+ nearlyEqual(fLetterSpacing, that.fLetterSpacing) &&
+ nearlyEqual(fWordSpacing, that.fWordSpacing) &&
+ nearlyEqual(fHeight, that.fHeight) &&
+ nearlyEqual(fFontSize, that.fFontSize) &&
fLocale == that.fLocale;
}
@@ -180,12 +180,12 @@
}
bool PlaceholderStyle::equals(const PlaceholderStyle& other) const {
- return SkScalarNearlyEqual(fWidth, other.fWidth) &&
- SkScalarNearlyEqual(fHeight, other.fHeight) &&
+ return nearlyEqual(fWidth, other.fWidth) &&
+ nearlyEqual(fHeight, other.fHeight) &&
fAlignment == other.fAlignment &&
fBaseline == other.fBaseline &&
(fAlignment != PlaceholderAlignment::kBaseline ||
- SkScalarNearlyEqual(fBaselineOffset, other.fBaselineOffset));
+ nearlyEqual(fBaselineOffset, other.fBaselineOffset));
}
} // namespace textlayout