summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-02-26 20:54:24 +0100
committerSteve Kondik <steve@cyngn.com>2015-02-26 20:54:47 +0100
commitc5d47d11e65f603a3e37ee876bc74751a30df592 (patch)
treef33a9530b7ac9b2a9c915a65d0a3844b5fb09b96 /include
parent4e4ab1a6c8347e977245d1126d10e48a3412d35d (diff)
downloadandroid_frameworks_minikin-c5d47d11e65f603a3e37ee876bc74751a30df592.tar.gz
android_frameworks_minikin-c5d47d11e65f603a3e37ee876bc74751a30df592.tar.bz2
android_frameworks_minikin-c5d47d11e65f603a3e37ee876bc74751a30df592.zip
* Seeing sporadic crashes with this patch. Reverting for now. This reverts commit 4e4ab1a6c8347e977245d1126d10e48a3412d35d. Change-Id: Ibcda62e8268e9a5559c0517695fa61f36f0d34d0
Diffstat (limited to 'include')
-rw-r--r--include/minikin/FontCollection.h12
-rw-r--r--include/minikin/FontFamily.h7
2 files changed, 9 insertions, 10 deletions
diff --git a/include/minikin/FontCollection.h b/include/minikin/FontCollection.h
index ffdb4d1..12700c6 100644
--- a/include/minikin/FontCollection.h
+++ b/include/minikin/FontCollection.h
@@ -21,6 +21,7 @@
#include <minikin/MinikinRefCounted.h>
#include <minikin/MinikinFont.h>
+#include <minikin/SparseBitSet.h>
#include <minikin/FontFamily.h>
namespace android {
@@ -51,12 +52,17 @@ 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;
};
- FontFamily* getFamilyForChar(uint32_t ch, FontLanguage lang, int variant) const;
+ const FontInstance* getInstanceForChar(uint32_t ch, FontLanguage lang, int variant) const;
// static for allocating unique id's
static uint32_t sNextId;
@@ -68,10 +74,10 @@ private:
uint32_t mMaxChar;
// This vector has ownership of the bitsets and typeface objects.
- std::vector<FontFamily*> mFamilies;
+ std::vector<FontInstance> mInstances;
// This vector contains pointers into mInstances
- std::vector<FontFamily*> mFamilyVec;
+ std::vector<const FontInstance*> mInstanceVec;
// 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 08c7a2c..bcc2e3a 100644
--- a/include/minikin/FontFamily.h
+++ b/include/minikin/FontFamily.h
@@ -23,7 +23,6 @@
#include <utils/TypeHelpers.h>
#include <minikin/MinikinRefCounted.h>
-#include <minikin/SparseBitSet.h>
namespace android {
@@ -140,9 +139,6 @@ 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);
@@ -156,9 +152,6 @@ private:
FontLanguage mLang;
int mVariant;
std::vector<Font> mFonts;
-
- SparseBitSet mCoverage;
- bool mCoverageValid;
};
} // namespace android