diff options
Diffstat (limited to 'gfx/thebes/gfxFontEntry.cpp')
-rw-r--r-- | gfx/thebes/gfxFontEntry.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 7ff5f82a85..840ef8943f 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -79,6 +79,7 @@ gfxFontEntry::gfxFontEntry(const nsACString& aName, bool aIsStandardFace) mHasGraphiteTables(LazyFlag::Uninitialized), mHasGraphiteSpaceContextuals(LazyFlag::Uninitialized), mHasColorBitmapTable(LazyFlag::Uninitialized), + mNeedsMaskForShadow(LazyFlag::Uninitialized), mHasSpaceFeatures(SpaceFeatures::Uninitialized) { mTrakTable.exchange(kTrakTableUninitialized); memset(&mDefaultSubSpaceFeatures, 0, sizeof(mDefaultSubSpaceFeatures)); @@ -355,7 +356,7 @@ bool gfxFontEntry::TryGetSVGData(const gfxFont* aFont) { mSVGInitialized = true; } - if (GetSVGGlyphs()) { + if (GetSVGGlyphs() && aFont) { AutoWriteLock lock(mLock); if (!mFontsUsingSVGGlyphs.Contains(aFont)) { mFontsUsingSVGGlyphs.AppendElement(aFont); @@ -2171,21 +2172,29 @@ gfxFontEntry* gfxFontFamily::FindFont(const nsACString& aFontName, } void gfxFontFamily::ReadAllCMAPs(FontInfoData* aFontInfoData) { - AutoWriteLock lock(mLock); - FindStyleVariationsLocked(aFontInfoData); + AutoTArray<RefPtr<gfxFontEntry>, 16> faces; + { + AutoWriteLock lock(mLock); + FindStyleVariationsLocked(aFontInfoData); + faces.AppendElements(mAvailableFonts); + } - uint32_t i, numFonts = mAvailableFonts.Length(); - for (i = 0; i < numFonts; i++) { - gfxFontEntry* fe = mAvailableFonts[i]; + gfxSparseBitSet familyMap; + for (auto& face : faces) { // don't try to load cmaps for downloadable fonts not yet loaded - if (!fe || fe->mIsUserFontContainer) { + if (!face || face->mIsUserFontContainer) { continue; } - fe->ReadCMAP(aFontInfoData); - mFamilyCharacterMap.Union(*(fe->GetCharacterMap())); + face->ReadCMAP(aFontInfoData); + familyMap.Union(*(face->GetCharacterMap())); + } + + AutoWriteLock lock(mLock); + if (!mFamilyCharacterMapInitialized) { + familyMap.Compact(); + mFamilyCharacterMap = std::move(familyMap); + mFamilyCharacterMapInitialized = true; } - mFamilyCharacterMap.Compact(); - mFamilyCharacterMapInitialized = true; } void gfxFontFamily::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, |