Skip to content

Commit

Permalink
Reland "Revert "update to new MakeFromStream signature""
Browse files Browse the repository at this point in the history
This reverts commit 8695539.

Reason for revert: Breaking the Housekeeper bot.

Original change's description:
> Revert "Revert "update to new MakeFromStream signature""
> 
> This reverts commit 71f8475.
> 
> Modified to still expose old signature (until we update google3 and flutter)
> 
> Bug: skia:
> Change-Id: Ie51e6227d5c6961d90006a015a5292cebd49e2a2
> Reviewed-on: https://skia-review.googlesource.com/152560
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I731108dac57aac090420594dc19e42c217f51b06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152600
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
  • Loading branch information
jvanverth authored and Skia Commit-Bot committed Sep 7, 2018
1 parent 8695539 commit 0b80e62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions include/ports/SkFontConfigInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "SkFontStyle.h"
#include "SkRefCnt.h"
#include "SkStream.h"
#include "SkTypeface.h"

class SkFontMgr;
Expand Down Expand Up @@ -98,9 +97,7 @@ class SK_API SkFontConfigInterface : public SkRefCnt {
* openStream(), but derived classes may implement more complex caching schemes.
*/
virtual sk_sp<SkTypeface> makeTypeface(const FontIdentity& identity) {
return SkTypeface::MakeFromStream(std::unique_ptr<SkStreamAsset>(this->openStream(identity)),
identity.fTTCIndex);

return SkTypeface::MakeFromStream(this->openStream(identity), identity.fTTCIndex);
}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/core/SkTypeface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ 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;
Expand Down

0 comments on commit 0b80e62

Please sign in to comment.