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

Commit 436f8ac7 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Revert "Remove obsolete interface GetTable."

This reverts commit 9cd73b68.

This causes a crash on Android Auto.
Bug: 32374752

Change-Id: I7fd0a52eb2458772ff50f246ca1c7d3397554133
parent 9cd73b68
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -65,6 +65,23 @@ void MinikinFontSkia::GetBounds(minikin::MinikinRect* bounds, uint32_t glyph_id,
    bounds->mBottom = skBounds.fBottom;
}

const void* MinikinFontSkia::GetTable(uint32_t tag, size_t* size,
        minikin::MinikinDestroyFunc* destroy) {
    // we don't have a buffer to the font data, copy to own buffer
    const size_t tableSize = mTypeface->getTableSize(tag);
    *size = tableSize;
    if (tableSize == 0) {
        return nullptr;
    }
    void* buf = malloc(tableSize);
    if (buf == nullptr) {
        return nullptr;
    }
    mTypeface->getTableData(tag, 0, tableSize, buf);
    *destroy = free;
    return buf;
}

SkTypeface *MinikinFontSkia::GetSkTypeface() const {
    return mTypeface.get();
}
+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ public:
    void GetBounds(minikin::MinikinRect* bounds, uint32_t glyph_id,
        const minikin::MinikinPaint &paint) const;

    const void* GetTable(uint32_t tag, size_t* size, minikin::MinikinDestroyFunc* destroy);

    SkTypeface* GetSkTypeface() const;
    sk_sp<SkTypeface> RefSkTypeface() const;