mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
e5ea29554a
4 changed files with 20 additions and 15 deletions
|
|
@ -495,7 +495,7 @@ public:
|
|||
|
||||
private:
|
||||
// The font table data block
|
||||
nsTArray<uint8_t> mTableData;
|
||||
const nsTArray<uint8_t> mTableData;
|
||||
|
||||
// The blob destroy function needs to know the owning font entry
|
||||
// so that it can hold the font-entry's reference while modifying the
|
||||
|
|
@ -591,11 +591,16 @@ gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag,
|
|||
mFontTableCache = MakeUnique<nsTHashtable<FontTableHashEntry>>(8);
|
||||
}
|
||||
|
||||
FontTableHashEntry *entry = mFontTableCache->PutEntry(aTag);
|
||||
if (MOZ_UNLIKELY(!entry)) { // OOM
|
||||
return nullptr;
|
||||
FontTableHashEntry* entry;
|
||||
if (MOZ_UNLIKELY(entry = mFontTableCache->GetEntry(aTag))) {
|
||||
// We must have been racing with another GetFontTable for the same table,
|
||||
// and it won the race and filled in the entry before us.
|
||||
// Ignore `aBuffer` in that case, and return a reference to the existing blob.
|
||||
return entry->GetBlob();
|
||||
}
|
||||
|
||||
entry = mFontTableCache->PutEntry(aTag);
|
||||
|
||||
if (!aBuffer) {
|
||||
// ensure the entry is null
|
||||
entry->Clear();
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ public:
|
|||
// unregisters the table from the font entry.
|
||||
//
|
||||
// Pass nullptr for aBuffer to indicate that the table is not present and
|
||||
// nullptr will be returned. Also returns nullptr on OOM.
|
||||
// nullptr will be returned.
|
||||
hb_blob_t *ShareFontTableAndGetBlob(uint32_t aTag,
|
||||
nsTArray<uint8_t>* aTable);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue