From edc6ea7a9e1ced35a5e3351aaea5003a299381dd Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Wed, 5 Sep 2018 17:04:30 -0400 Subject: [PATCH] update to new MakeFromStream signature Bug: skia: Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52 Reviewed-on: https://skia-review.googlesource.com/151880 Commit-Queue: Mike Reed Reviewed-by: Derek Sollenberger --- include/core/SkTypeface.h | 7 ------- include/ports/SkFontConfigInterface.h | 5 ++++- src/core/SkTypeface.cpp | 7 ------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h index 7c2c334a99..430397d3e3 100644 --- a/include/core/SkTypeface.h +++ b/include/core/SkTypeface.h @@ -33,8 +33,6 @@ typedef uint32_t SkFontID; /** Machine endian. */ typedef uint32_t SkFontTableTag; -#define SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM - /** \class SkTypeface The SkTypeface class specifies the typeface and intrinsic style of a font. @@ -131,11 +129,6 @@ public: */ static sk_sp MakeFromStream(std::unique_ptr stream, int index = 0); -#ifdef SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM - // DEPRECATED -- call the version that takes unique_ptr - static sk_sp MakeFromStream(SkStreamAsset* stream, int index = 0); -#endif - /** Return a new typeface given a SkData. If the data is null, or is not a valid font file, * returns nullptr. */ diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h index 12f777d655..01346f2531 100644 --- a/include/ports/SkFontConfigInterface.h +++ b/include/ports/SkFontConfigInterface.h @@ -10,6 +10,7 @@ #include "SkFontStyle.h" #include "SkRefCnt.h" +#include "SkStream.h" #include "SkTypeface.h" class SkFontMgr; @@ -97,7 +98,9 @@ public: * openStream(), but derived classes may implement more complex caching schemes. */ virtual sk_sp makeTypeface(const FontIdentity& identity) { - return SkTypeface::MakeFromStream(this->openStream(identity), identity.fTTCIndex); + return SkTypeface::MakeFromStream(std::unique_ptr(this->openStream(identity)), + identity.fTTCIndex); + } /** diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp index 8255c431a0..7bfd47733d 100644 --- a/src/core/SkTypeface.cpp +++ b/src/core/SkTypeface.cpp @@ -145,13 +145,6 @@ sk_sp SkTypeface::MakeFromName(const char name[], return SkFontMgr::RefDefault()->legacyMakeTypeface(name, fontStyle); } -#ifdef SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM -// DEPRECATED -sk_sp SkTypeface::MakeFromStream(SkStreamAsset* stream, int index) { - return MakeFromStream(std::unique_ptr(stream), index); -} -#endif - sk_sp SkTypeface::MakeFromStream(std::unique_ptr stream, int index) { if (!stream) { return nullptr;