From 253320d25fccbb49621926d49dcf5ef64cf529c6 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Wed, 29 Oct 2014 11:04:04 -0700 Subject: Move coverage bitmap from FontCollection to FontFamily This will significantly reduce memory usage and also speed the creation of new font families. In particular, the coverage bitmaps for the fonts in the fallback stack will be computed once in the Zygote, rather than separately in each app process. Bug: 17756900 Change-Id: I66f5706bddd4658d78fe5b709f7251ca9d2ff4f8 --- include/minikin/FontCollection.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include/minikin/FontCollection.h') diff --git a/include/minikin/FontCollection.h b/include/minikin/FontCollection.h index 12700c6..ffdb4d1 100644 --- a/include/minikin/FontCollection.h +++ b/include/minikin/FontCollection.h @@ -21,7 +21,6 @@ #include #include -#include #include namespace android { @@ -52,17 +51,12 @@ private: static const int kLogCharsPerPage = 8; static const int kPageMask = (1 << kLogCharsPerPage) - 1; - struct FontInstance { - SparseBitSet* mCoverage; - FontFamily* mFamily; - }; - struct Range { size_t start; size_t end; }; - const FontInstance* getInstanceForChar(uint32_t ch, FontLanguage lang, int variant) const; + FontFamily* getFamilyForChar(uint32_t ch, FontLanguage lang, int variant) const; // static for allocating unique id's static uint32_t sNextId; @@ -74,10 +68,10 @@ private: uint32_t mMaxChar; // This vector has ownership of the bitsets and typeface objects. - std::vector mInstances; + std::vector mFamilies; // This vector contains pointers into mInstances - std::vector mInstanceVec; + std::vector mFamilyVec; // These are offsets into mInstanceVec, one range per page std::vector mRanges; -- cgit v1.2.3