Index: include/core/SkFontStyle.h |
diff --git a/include/core/SkFontStyle.h b/include/core/SkFontStyle.h |
index f42d7dd4701824b6f15666bf875c839b41216092..4489bd8c65188586131338057a8e947c41f95f1b 100644 |
--- a/include/core/SkFontStyle.h |
+++ b/include/core/SkFontStyle.h |
@@ -43,8 +43,13 @@ public: |
SkFontStyle(); |
SkFontStyle(int weight, int width, Slant); |
- /** oldStyle means the style-bits in SkTypeface::Style: bold=1, italic=2 */ |
- explicit SkFontStyle(unsigned oldStyle); |
+ |
+ static SkFontStyle FromOldStyle(unsigned oldStyle); |
+ |
+ explicit SkFontStyle(uint32_t d) |
dogben
2016/04/11 20:28:58
I don't see anywhere you use the uint32_t construc
bungeman-skia
2016/04/11 21:55:52
This was done to make the Chromium side IPC change
|
+ : SkFontStyle(Data{d}.fR.fWeight, Data{d}.fR.fWidth, static_cast<Slant>(Data{d}.fR.fSlant)) |
+ {} |
+ explicit operator uint32_t() { return fUnion.fU32; } |
bool operator==(const SkFontStyle& rhs) const { |
return fUnion.fU32 == rhs.fUnion.fU32; |
@@ -59,13 +64,13 @@ public: |
} |
private: |
- union { |
+ union Data { |
+ uint32_t fU32; |
struct { |
uint16_t fWeight; // 100 .. 900 |
uint8_t fWidth; // 1 .. 9 |
uint8_t fSlant; // 0 .. 2 |
} fR; |
- uint32_t fU32; |
} fUnion; |
}; |