diff options
| author | 2018-09-05 14:55:14 -0400 | |
|---|---|---|
| committer | 2018-09-05 17:08:23 -0400 | |
| commit | 61066649e64bb987a82e5c3d8d00ad98e9c21158 (patch) | |
| tree | c2ff05af1e0d79a9d9279f9aff1dc6e260253557 | |
| parent | f8c9282061f555cecad907b0466c496e14e6b998 (diff) | |
use unique_ptr version of MakeFromStream
Test: make
Change-Id: I30cad3e78cc7359ccd10b6041d6371d7e2da5623
| -rw-r--r-- | libs/hwui/hwui/Typeface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/hwui/Typeface.cpp b/libs/hwui/hwui/Typeface.cpp index d9856336e8bd..e8332a807636 100644 --- a/libs/hwui/hwui/Typeface.cpp +++ b/libs/hwui/hwui/Typeface.cpp @@ -178,8 +178,8 @@ void Typeface::setRobotoTypefaceForTest() { struct stat st = {}; LOG_ALWAYS_FATAL_IF(fstat(fd, &st) == -1, "Failed to stat file %s", kRobotoFont); void* data = mmap(nullptr, st.st_size, PROT_READ, MAP_SHARED, fd, 0); - std::unique_ptr<SkMemoryStream> fontData(new SkMemoryStream(data, st.st_size)); - sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(fontData.release()); + std::unique_ptr<SkStreamAsset> fontData(new SkMemoryStream(data, st.st_size)); + sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(std::move(fontData)); LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", kRobotoFont); std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>( |