Prevent kDefaultFontFamilies from being destroyed during atexit.

Change-Id: Ie9324622c27fefe2d876f462b7c106dbc2a4f2cb
Bug: skia:13432
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550177
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2022-06-15 09:02:16 -04:00 committed by SkCQ
parent b9307774a2
commit de3e1964cf
2 changed files with 4 additions and 3 deletions

View File

@ -260,7 +260,7 @@ public:
void setPlaceholder() { fIsPlaceholder = true; }
private:
static const std::vector<SkString> kDefaultFontFamilies;
static const std::vector<SkString>* kDefaultFontFamilies;
Decoration fDecoration = {
TextDecoration::kNoDecoration,
@ -274,7 +274,7 @@ private:
SkFontStyle fFontStyle;
std::vector<SkString> fFontFamilies = kDefaultFontFamilies;
std::vector<SkString> fFontFamilies = *kDefaultFontFamilies;
SkScalar fFontSize = 14.0;
SkScalar fHeight = 1.0;

View File

@ -6,7 +6,8 @@
namespace skia {
namespace textlayout {
const std::vector<SkString> TextStyle::kDefaultFontFamilies = { SkString(DEFAULT_FONT_FAMILY) };
const std::vector<SkString>* TextStyle::kDefaultFontFamilies =
new std::vector<SkString>{SkString(DEFAULT_FONT_FAMILY)};
TextStyle TextStyle::cloneForPlaceholder() {
TextStyle result;