update to new MakeFromStream signature
Bug: skia: Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52 Reviewed-on: https://skia-review.googlesource.com/151880 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
This commit is contained in:
parent
ffbcc3fadf
commit
edc6ea7a9e
@ -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<SkTypeface> MakeFromStream(std::unique_ptr<SkStreamAsset> stream, int index = 0);
|
||||
|
||||
#ifdef SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
|
||||
// DEPRECATED -- call the version that takes unique_ptr
|
||||
static sk_sp<SkTypeface> 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.
|
||||
*/
|
||||
|
@ -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<SkTypeface> makeTypeface(const FontIdentity& identity) {
|
||||
return SkTypeface::MakeFromStream(this->openStream(identity), identity.fTTCIndex);
|
||||
return SkTypeface::MakeFromStream(std::unique_ptr<SkStreamAsset>(this->openStream(identity)),
|
||||
identity.fTTCIndex);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,13 +145,6 @@ sk_sp<SkTypeface> SkTypeface::MakeFromName(const char name[],
|
||||
return SkFontMgr::RefDefault()->legacyMakeTypeface(name, fontStyle);
|
||||
}
|
||||
|
||||
#ifdef SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
|
||||
// DEPRECATED
|
||||
sk_sp<SkTypeface> SkTypeface::MakeFromStream(SkStreamAsset* stream, int index) {
|
||||
return MakeFromStream(std::unique_ptr<SkStreamAsset>(stream), index);
|
||||
}
|
||||
#endif
|
||||
|
||||
sk_sp<SkTypeface> SkTypeface::MakeFromStream(std::unique_ptr<SkStreamAsset> stream, int index) {
|
||||
if (!stream) {
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user