Update to newer Skia font API (flutter/engine#6236)

This function now takes an sk_sp
This commit is contained in:
Brian Osman
2018-09-12 10:47:29 -04:00
committed by GitHub
parent c6495888b8
commit ac8e6f763f
2 changed files with 2 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ SkTypeface* AssetManagerFontStyleSet::createTypeface(int i) {
std::unique_ptr<SkMemoryStream> stream = SkMemoryStream::Make(asset_data);
// Ownership of the stream is transferred.
asset.typeface = SkTypeface::MakeFromStream(stream.release());
asset.typeface = SkTypeface::MakeFromStream(std::move(stream));
if (!asset.typeface)
return nullptr;
}

View File

@@ -96,7 +96,7 @@ void FontCollection::RegisterFonts(fml::RefPtr<AssetManager> asset_manager) {
void FontCollection::RegisterTestFonts() {
sk_sp<SkTypeface> test_typeface =
SkTypeface::MakeFromStream(GetTestFontData().release());
SkTypeface::MakeFromStream(GetTestFontData());
std::unique_ptr<txt::TypefaceFontAssetProvider> font_provider =
std::make_unique<txt::TypefaceFontAssetProvider>();