Loading libs/hwui/hwui/Typeface.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,9 @@ #include "MinikinSkia.h" #include "SkPaint.h" #include "SkStream.h" // Fot tests. #include "SkStream.h" // For tests. #include "SkTypeface.h" #include "utils/TypefaceUtils.h" #include <minikin/FontCollection.h> #include <minikin/FontFamily.h> Loading Loading @@ -186,7 +187,9 @@ void Typeface::setRobotoTypefaceForTest() { 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<SkStreamAsset> fontData(new SkMemoryStream(data, st.st_size)); sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(std::move(fontData)); sk_sp<SkFontMgr> fm = android::FreeTypeFontMgr(); LOG_ALWAYS_FATAL_IF(fm == nullptr, "Could not load FreeType SkFontMgr"); sk_sp<SkTypeface> typeface = fm->makeFromStream(std::move(fontData)); LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", kRobotoFont); std::shared_ptr<minikin::MinikinFont> font = Loading Loading
libs/hwui/hwui/Typeface.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,9 @@ #include "MinikinSkia.h" #include "SkPaint.h" #include "SkStream.h" // Fot tests. #include "SkStream.h" // For tests. #include "SkTypeface.h" #include "utils/TypefaceUtils.h" #include <minikin/FontCollection.h> #include <minikin/FontFamily.h> Loading Loading @@ -186,7 +187,9 @@ void Typeface::setRobotoTypefaceForTest() { 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<SkStreamAsset> fontData(new SkMemoryStream(data, st.st_size)); sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(std::move(fontData)); sk_sp<SkFontMgr> fm = android::FreeTypeFontMgr(); LOG_ALWAYS_FATAL_IF(fm == nullptr, "Could not load FreeType SkFontMgr"); sk_sp<SkTypeface> typeface = fm->makeFromStream(std::move(fontData)); LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", kRobotoFont); std::shared_ptr<minikin::MinikinFont> font = Loading