mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1786281 - Expose AutoHBBlob as a public helper in gfxFontUtils. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D155208
This commit is contained in:
parent
326adff110
commit
166dab3f9d
@ -25,8 +25,6 @@
|
|||||||
#include "mozilla/ServoStyleSet.h"
|
#include "mozilla/ServoStyleSet.h"
|
||||||
#include "mozilla/dom/WorkerCommon.h"
|
#include "mozilla/dom/WorkerCommon.h"
|
||||||
|
|
||||||
#include "harfbuzz/hb.h"
|
|
||||||
|
|
||||||
#include "plbase64.h"
|
#include "plbase64.h"
|
||||||
#include "mozilla/Logging.h"
|
#include "mozilla/Logging.h"
|
||||||
|
|
||||||
@ -1604,19 +1602,6 @@ void gfxFontUtils::GetVariationData(
|
|||||||
// AutoSwap_PRUint16 postScriptNameID;
|
// AutoSwap_PRUint16 postScriptNameID;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper to ensure we free a font table when we return.
|
|
||||||
class AutoHBBlob {
|
|
||||||
public:
|
|
||||||
explicit AutoHBBlob(hb_blob_t* aBlob) : mBlob(aBlob) {}
|
|
||||||
|
|
||||||
~AutoHBBlob() { hb_blob_destroy(mBlob); }
|
|
||||||
|
|
||||||
operator hb_blob_t*() { return mBlob; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
hb_blob_t* const mBlob;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Load the two font tables we need as harfbuzz blobs; if either is absent,
|
// Load the two font tables we need as harfbuzz blobs; if either is absent,
|
||||||
// just bail out.
|
// just bail out.
|
||||||
AutoHBBlob fvarTable(
|
AutoHBBlob fvarTable(
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
#include "harfbuzz/hb.h"
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/Casting.h"
|
#include "mozilla/Casting.h"
|
||||||
@ -908,6 +909,19 @@ class gfxFontUtils {
|
|||||||
// (in bytes).
|
// (in bytes).
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Helper to ensure we free a font table when we return.
|
||||||
|
class AutoHBBlob {
|
||||||
|
public:
|
||||||
|
explicit AutoHBBlob(hb_blob_t* aBlob) : mBlob(aBlob) {}
|
||||||
|
|
||||||
|
~AutoHBBlob() { hb_blob_destroy(mBlob); }
|
||||||
|
|
||||||
|
operator hb_blob_t*() { return mBlob; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
hb_blob_t* const mBlob;
|
||||||
|
};
|
||||||
|
|
||||||
// for reading big-endian font data on either big or little-endian platforms
|
// for reading big-endian font data on either big or little-endian platforms
|
||||||
|
|
||||||
static inline uint16_t ReadShortAt(const uint8_t* aBuf, uint32_t aIndex) {
|
static inline uint16_t ReadShortAt(const uint8_t* aBuf, uint32_t aIndex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user