aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Bruce Wang <brucewang@google.com>2018-06-25 11:37:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-25 20:42:25 +0000
commit536ad2c146b72eb61f7df47fd88e296f879e6611 (patch)
treeabdbc926d4875de8b345164399338302f1cce589 /tests
parentff168d9258e0101826a8072b4ee077c3d2aa7258 (diff)
Implement onMakeClone function on all subclasses of SkTypeface except
on mac. Change-Id: I2b8777a5b54e190c37623ab798a89b4f1833ceac Reviewed-on: https://skia-review.googlesource.com/137382 Commit-Queue: Bruce Wang <brucewang@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/FontMgrTest.cpp3
-rw-r--r--tests/TypefaceTest.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp
index 17a60bbd79..4abbd19fb9 100644
--- a/tests/FontMgrTest.cpp
+++ b/tests/FontMgrTest.cpp
@@ -128,6 +128,9 @@ static void test_matchStyleCSS3(skiatest::Reporter* reporter) {
TestTypeface(const SkFontStyle& fontStyle) : SkTypeface(fontStyle, false){}
protected:
SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
+ sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
+ return sk_ref_sp(this);
+ }
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override {
return nullptr;
diff --git a/tests/TypefaceTest.cpp b/tests/TypefaceTest.cpp
index f0253ef08f..757f3a5e44 100644
--- a/tests/TypefaceTest.cpp
+++ b/tests/TypefaceTest.cpp
@@ -235,6 +235,9 @@ protected:
EmptyTypeface() : SkTypeface(SkFontStyle(), true) { }
SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
+ sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override {
+ return sk_ref_sp(this);
+ }
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const override {
return nullptr;