diff options
author | 2017-07-31 15:41:14 -0400 | |
---|---|---|
committer | 2017-07-31 20:24:47 +0000 | |
commit | 0500ebafec1879a7c5f76fe40ee30bdab17ac3db (patch) | |
tree | 09c6bb735ae81e3ebc16f64eadc6d46209182350 /src | |
parent | 49f58a3825ca7f7745d7f311baa2b65c5eb46c02 (diff) |
Remove union from SkFontStyle.
This is prompted by a bug in vc++ reported at
https://developercommunity.visualstudio.com/content/problem/86829/constexpr-initializing-struct-in-union-only-zero-i.html
Visual C++ will not properly constexpr initialize a struct inside a
union. Removing this construct also allows us to avoid writing and
reading from different members of a union.
Change-Id: I76e069ecce77ef21b7ad3821bf9c29e1b0843618
Reviewed-on: https://skia-review.googlesource.com/28300
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkFontStyle.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/core/SkFontStyle.cpp b/src/core/SkFontStyle.cpp index 24ee645a4f..996d383402 100644 --- a/src/core/SkFontStyle.cpp +++ b/src/core/SkFontStyle.cpp @@ -9,13 +9,6 @@ #include "SkTypeface.h" #include "SkTypes.h" -SkFontStyle::SkFontStyle() { - fUnion.fU32 = 0; - fUnion.fR.fWeight = kNormal_Weight; - fUnion.fR.fWidth = kNormal_Width; - fUnion.fR.fSlant = kUpright_Slant; -} - /*static*/SkFontStyle SkFontStyle::FromOldStyle(unsigned oldStyle) { return SkFontStyle((oldStyle & SkTypeface::kBold) ? SkFontStyle::kBold_Weight : SkFontStyle::kNormal_Weight, |