diff options
| author | 2018-09-05 23:51:43 +0000 | |
|---|---|---|
| committer | 2018-09-05 23:51:43 +0000 | |
| commit | 0d100c0ace3e9a6a6cabeafb70f68b385685d414 (patch) | |
| tree | 4d3e13a5194dec72fa500d657ca22ca26f1a590a | |
| parent | 57968dd46a407be386c0519b7cf9479007f6f2ac (diff) | |
| parent | 61066649e64bb987a82e5c3d8d00ad98e9c21158 (diff) | |
Merge "use unique_ptr version of MakeFromStream"
| -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>( |