Update types in TextStyle to use member initialization syntax.
While doing a refactor, Clang issued some warnings about having copy-
constructors without assignment operators in some TextStyle classes.
Rewrote the code to minimize custom constructor/copy/assignment methods,
favoring C++11 member initialization syntax instead.
Change-Id: I4f0361ce38d4b0ada346b0ede4fcad4e2b686d67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305959
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/modules/skparagraph/src/TextStyle.cpp b/modules/skparagraph/src/TextStyle.cpp
index cb12c7f..0299f46 100644
--- a/modules/skparagraph/src/TextStyle.cpp
+++ b/modules/skparagraph/src/TextStyle.cpp
@@ -6,32 +6,7 @@
namespace skia {
namespace textlayout {
-TextStyle::TextStyle() : fFontStyle() {
- fFontFamilies.reserve(1);
- fFontFamilies.emplace_back(DEFAULT_FONT_FAMILY);
- fColor = SK_ColorWHITE;
- fDecoration.fType = TextDecoration::kNoDecoration;
- // Does not make sense to draw a transparent object, so we use it as a default
- // value to indicate no decoration color was set.
- fDecoration.fColor = SK_ColorTRANSPARENT;
- fDecoration.fStyle = TextDecorationStyle::kSolid;
- // TODO: switch back to kGaps when (if) switching flutter to skparagraph
- fDecoration.fMode = TextDecorationMode::kThrough;
- // Thickness is applied as a multiplier to the default thickness of the font.
- fDecoration.fThicknessMultiplier = 1.0;
- fFontSize = 14.0;
- fLetterSpacing = 0.0;
- fWordSpacing = 0.0;
- fHeight = 1.0;
- fHeightOverride = false;
- fHasBackground = false;
- fHasForeground = false;
- fTextBaseline = TextBaseline::kAlphabetic;
- fLocale = "";
- fIsPlaceholder = false;
-}
-
-TextStyle:: TextStyle(const TextStyle& other, bool placeholder) {
+TextStyle::TextStyle(const TextStyle& other, bool placeholder) {
fColor = other.fColor;
fFontSize = other.fFontSize;
fFontFamilies = other.fFontFamilies;