From 63a5e127e925d11da3c44e8295fcf9801e3194aa Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 12 Sep 2018 09:04:27 -0400 Subject: [PATCH] Update to newer Skia font API This function now takes an sk_sp --- lib/ui/text/asset_manager_font_provider.cc | 2 +- lib/ui/text/font_collection.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/text/asset_manager_font_provider.cc b/lib/ui/text/asset_manager_font_provider.cc index 7edcbe6706f3f..6caf8dd898b91 100644 --- a/lib/ui/text/asset_manager_font_provider.cc +++ b/lib/ui/text/asset_manager_font_provider.cc @@ -103,7 +103,7 @@ SkTypeface* AssetManagerFontStyleSet::createTypeface(int i) { std::unique_ptr 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; } diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 987bbfaa76041..b5a88354cc05b 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -96,7 +96,7 @@ void FontCollection::RegisterFonts(fml::RefPtr asset_manager) { void FontCollection::RegisterTestFonts() { sk_sp test_typeface = - SkTypeface::MakeFromStream(GetTestFontData().release()); + SkTypeface::MakeFromStream(GetTestFontData()); std::unique_ptr font_provider = std::make_unique();