Fixing the cache
Change-Id: Ief6ce50095c73498307748d30608100c10790746
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264399
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
diff --git a/modules/skparagraph/src/TextStyle.cpp b/modules/skparagraph/src/TextStyle.cpp
index 5582303..d4d1b81 100644
--- a/modules/skparagraph/src/TextStyle.cpp
+++ b/modules/skparagraph/src/TextStyle.cpp
@@ -102,6 +102,18 @@
return true;
}
+bool TextStyle::equalsByFonts(const TextStyle& that) const {
+
+ return !fIsPlaceholder && !that.fIsPlaceholder &&
+ fFontStyle == that.fFontStyle &&
+ fFontFamilies == that.fFontFamilies &&
+ fLetterSpacing == that.fLetterSpacing &&
+ fWordSpacing == that.fWordSpacing &&
+ fHeight == that.fHeight &&
+ fFontSize == that.fFontSize &&
+ fLocale == that.fLocale;
+}
+
bool TextStyle::matchOneAttribute(StyleType styleType, const TextStyle& other) const {
switch (styleType) {
case kForeground:
@@ -166,5 +178,13 @@
}
}
+bool PlaceholderStyle::equals(const PlaceholderStyle& other) const {
+ return this->fWidth == other.fWidth &&
+ this->fHeight == other.fHeight &&
+ this->fAlignment == other.fAlignment &&
+ this->fBaseline == other.fBaseline &&
+ this->fBaselineOffset == other.fBaselineOffset;
+}
+
} // namespace textlayout
} // namespace skia