aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Bruce Wang <brucewang@google.com>2018-06-20 16:43:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-21 16:32:28 +0000
commit37b6109cde2b50d366d5f6ac38cc1c043081230d (patch)
tree50615bcd8368deace45474f7df8f1a89b6736b01 /src
parentae167ed72e9319abdac28fb5e80089a00ae85f01 (diff)
Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_AndroidSystem.
Add FontMgrAndroidSystemVariableTypeface test to test the above function. Change-Id: I36a2f65550784a86feecc6ef69a870a33e973804 Reviewed-on: https://skia-review.googlesource.com/136248 Commit-Queue: Bruce Wang <brucewang@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/ports/SkFontMgr_android.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 5194e1f7b7..a7cbd97d26 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -98,6 +98,22 @@ public:
return skstd::make_unique<SkFontData>(this->makeStream(), fIndex,
fAxes.begin(), fAxes.count());
}
+ sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
+ std::unique_ptr<SkFontData> data = this->cloneFontData(args);
+ if (!data) {
+ return nullptr;
+ }
+ return sk_make_sp<SkTypeface_AndroidSystem>(fPathName,
+ fFile,
+ fIndex,
+ data->getAxis(),
+ data->getAxisCount(),
+ this->fontStyle(),
+ this->isFixedPitch(),
+ fFamilyName,
+ fLang,
+ fVariantStyle);
+ }
const SkString fPathName;
int fIndex;