Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99d66f06 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Update Typeface test implementation not to copy minikin::Font

Test: hwui_unit_tests
Bug: 65024629
Change-Id: I974c11ed4d258934fb4f2bec95bede33b2261629
parent da252ac5
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -182,10 +182,11 @@ void Typeface::setRobotoTypefaceForTest() {

    std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
            std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
    std::shared_ptr<minikin::FontFamily> family = std::make_shared<minikin::FontFamily>(
            std::vector<minikin::Font>({minikin::Font(std::move(font), minikin::FontStyle())}));
    std::shared_ptr<minikin::FontCollection> collection =
            std::make_shared<minikin::FontCollection>(std::move(family));
    std::vector<minikin::Font> fonts;
    fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));

    std::shared_ptr<minikin::FontCollection> collection = std::make_shared<minikin::FontCollection>(
            std::make_shared<minikin::FontFamily>(std::move(fonts)));

    Typeface* hwTypeface = new Typeface();
    hwTypeface->fFontCollection = collection;
+3 −2
Original line number Diff line number Diff line
@@ -56,8 +56,9 @@ std::shared_ptr<minikin::FontFamily> buildFamily(const char* fileName) {
    LOG_ALWAYS_FATAL_IF(typeface == nullptr, "Failed to make typeface from %s", fileName);
    std::shared_ptr<minikin::MinikinFont> font = std::make_shared<MinikinFontSkia>(
            std::move(typeface), data, st.st_size, 0, std::vector<minikin::FontVariation>());
    return std::make_shared<minikin::FontFamily>(
            std::vector<minikin::Font>({minikin::Font(std::move(font), minikin::FontStyle())}));
    std::vector<minikin::Font> fonts;
    fonts.push_back(minikin::Font(std::move(font), minikin::FontStyle()));
    return std::make_shared<minikin::FontFamily>(std::move(fonts));
}

std::vector<std::shared_ptr<minikin::FontFamily>> makeSingleFamlyVector(const char* fileName) {