Remove SkFontMgr::matchFaceStyle.

This belongs on a SkTypeface which might have a back pointer to a font
collection in which it can do lookup. It makes little sense to pass a
random typeface into a potentially incompatible SkFontMgr. Some of the
existing implementations will crash if this happens.

This initial commit is 'conservative' in that it removes the public API,
the backing onMatchFaceStyle is left intact to avoid breaking
implementors (as opposed to users). It may also be used as an
implementation detail in a future SkTypeface API when the typeface holds
a reference on its collection.

It appears there are no users of this API and it is also untested.

Change-Id: I6e06f918ad73a500c254746b3957c3579fab3b9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299198
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2020-06-25 14:55:16 -04:00 committed by Skia Commit-Bot
parent 3d00fc9924
commit d71cf40301
2 changed files with 0 additions and 7 deletions

View File

@ -87,8 +87,6 @@ public:
const char* bcp47[], int bcp47Count,
SkUnichar character) const;
SkTypeface* matchFaceStyle(const SkTypeface*, const SkFontStyle&) const;
/**
* Create a typeface for the specified data and TTC index (pass 0 for none)
* or NULL if the data is not recognized. The caller must call unref() on

View File

@ -118,11 +118,6 @@ SkTypeface* SkFontMgr::matchFamilyStyleCharacter(const char familyName[], const
return this->onMatchFamilyStyleCharacter(familyName, style, bcp47, bcp47Count, character);
}
SkTypeface* SkFontMgr::matchFaceStyle(const SkTypeface* face,
const SkFontStyle& fs) const {
return this->onMatchFaceStyle(face, fs);
}
sk_sp<SkTypeface> SkFontMgr::makeFromData(sk_sp<SkData> data, int ttcIndex) const {
if (nullptr == data) {
return nullptr;