aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontMgr_android.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-04-12 13:45:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-12 13:45:06 -0700
commit11a77c6e0634e2feb6fe4e74806db2fdd2a799ec (patch)
treed62d216858bbe136c4b41b9ec563ea35bd7ff1ed /src/ports/SkFontMgr_android.cpp
parent0586f5cc9713268238394411a5daa2c7758b092b (diff)
Begin switch to SkFontStyle for legacy calls.
This adds SK_VERY_LEGACY_CREATE_TYPEFACE which, when defined, provides only the old interface. Ideally, everyone would switch directly to SkFontMgr and use one of the newer calls, but there is currently no path for current users to get there. This updates all the internals to use SkFontStyle, after switching these over the higher level APIs can be switched. The Chromium follow on patch can be seen at https://crrev.com/1877673002 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1873923002 TBR=reed This doesn't really change API, just modernizes it. Review URL: https://codereview.chromium.org/1873923002
Diffstat (limited to 'src/ports/SkFontMgr_android.cpp')
-rw-r--r--src/ports/SkFontMgr_android.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index ead0bf0b83..741d6cc173 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -487,11 +487,12 @@ protected:
return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
}
-
- virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
- unsigned styleBits) const override {
- SkFontStyle style = SkFontStyle(styleBits);
-
+#ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) const override {
+ SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
+#else
+ SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle style) const override {
+#endif
if (familyName) {
// On Android, we must return nullptr when we can't find the requested
// named typeface so that the system/app can provide their own recovery