diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-03-10 12:05:00 +0000 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-03-10 12:05:00 +0000 |
commit | eff9f1e9373a61d65217fdfec3702d376a793978 (patch) | |
tree | 1de01efab8dc3c9ec5026fa93cfe3d60d0d5d217 /include | |
parent | c5d47d11e65f603a3e37ee876bc74751a30df592 (diff) | |
parent | 253320d25fccbb49621926d49dcf5ef64cf529c6 (diff) | |
download | android_frameworks_minikin-stable/cm-12.1-YOG3C.tar.gz android_frameworks_minikin-stable/cm-12.1-YOG3C.tar.bz2 android_frameworks_minikin-stable/cm-12.1-YOG3C.zip |
Merge tag 'android-5.1.0_r1' into HEADstaging/cm-12.1stable/cm-12.1-YOG3C
Android 5.1.0 release 1
Diffstat (limited to 'include')
-rw-r--r-- | include/minikin/FontCollection.h | 12 | ||||
-rw-r--r-- | include/minikin/FontFamily.h | 7 |
2 files changed, 10 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; 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 |