diff options
author | Raph Levien <raph@google.com> | 2014-10-29 11:04:04 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2014-10-29 12:34:50 -0700 |
commit | 253320d25fccbb49621926d49dcf5ef64cf529c6 (patch) | |
tree | 1de01efab8dc3c9ec5026fa93cfe3d60d0d5d217 /include/minikin/FontFamily.h | |
parent | 5f11abd31fa8cfa723f54bd1c98ce4e27e7d3c77 (diff) | |
download | android_frameworks_minikin-253320d25fccbb49621926d49dcf5ef64cf529c6.tar.gz android_frameworks_minikin-253320d25fccbb49621926d49dcf5ef64cf529c6.tar.bz2 android_frameworks_minikin-253320d25fccbb49621926d49dcf5ef64cf529c6.zip |
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
Diffstat (limited to 'include/minikin/FontFamily.h')
-rw-r--r-- | include/minikin/FontFamily.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/minikin/FontFamily.h b/include/minikin/FontFamily.h index bcc2e3a..08c7a2c 100644 --- a/include/minikin/FontFamily.h +++ b/include/minikin/FontFamily.h @@ -23,6 +23,7 @@ #include <utils/TypeHelpers.h> #include <minikin/MinikinRefCounted.h> +#include <minikin/SparseBitSet.h> namespace android { @@ -139,6 +140,9 @@ public: size_t getNumFonts() const; MinikinFont* getFont(size_t index) const; FontStyle getStyle(size_t index) const; + + // Get Unicode coverage. Lifetime of returned bitset is same as receiver. + const SparseBitSet* getCoverage(); private: void addFontLocked(MinikinFont* typeface, FontStyle style); @@ -152,6 +156,9 @@ private: FontLanguage mLang; int mVariant; std::vector<Font> mFonts; + + SparseBitSet mCoverage; + bool mCoverageValid; }; } // namespace android |