summaryrefslogtreecommitdiff
path: root/include/minikin/FontCollection.h
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-10-29 11:04:04 -0700
committerRaph Levien <raph@google.com>2014-10-29 12:34:50 -0700
commit253320d25fccbb49621926d49dcf5ef64cf529c6 (patch)
tree1de01efab8dc3c9ec5026fa93cfe3d60d0d5d217 /include/minikin/FontCollection.h
parent5f11abd31fa8cfa723f54bd1c98ce4e27e7d3c77 (diff)
downloadminikin-android-5.1.1_r4.tar.gz
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/FontCollection.h')
-rw-r--r--include/minikin/FontCollection.h12
1 files changed, 3 insertions, 9 deletions
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 <minikin/MinikinRefCounted.h>
#include <minikin/MinikinFont.h>
-#include <minikin/SparseBitSet.h>
#include <minikin/FontFamily.h>
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<FontInstance> mInstances;
+ std::vector<FontFamily*> mFamilies;
// This vector contains pointers into mInstances
- std::vector<const FontInstance*> mInstanceVec;
+ std::vector<FontFamily*> mFamilyVec;
// These are offsets into mInstanceVec, one range per page
std::vector<Range> mRanges;