зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329670: Change gfxFont::CopyWithAntialiasOption to return UniquePtr instead of raw pointer. r=jfkthame
MozReview-Commit-ID: B5UNazyXPL2
This commit is contained in:
Родитель
05deb31a6e
Коммит
eb14ae51cf
|
@ -126,11 +126,11 @@ gfxDWriteFont::UpdateClearTypeUsage()
|
|||
mUseClearType = UsingClearType();
|
||||
}
|
||||
|
||||
gfxFont*
|
||||
UniquePtr<gfxFont>
|
||||
gfxDWriteFont::CopyWithAntialiasOption(AntialiasOption anAAOption)
|
||||
{
|
||||
return new gfxDWriteFont(static_cast<gfxDWriteFontEntry*>(mFontEntry.get()),
|
||||
&mStyle, mNeedsBold, anAAOption);
|
||||
auto entry = static_cast<gfxDWriteFontEntry*>(mFontEntry.get());
|
||||
return MakeUnique<gfxDWriteFont>(entry, &mStyle, mNeedsBold, anAAOption);
|
||||
}
|
||||
|
||||
const gfxFont::Metrics&
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
static void UpdateClearTypeUsage();
|
||||
|
||||
virtual gfxFont*
|
||||
mozilla::UniquePtr<gfxFont>
|
||||
CopyWithAntialiasOption(AntialiasOption anAAOption) override;
|
||||
|
||||
virtual uint32_t GetSpaceGlyph() override;
|
||||
|
|
|
@ -2305,7 +2305,7 @@ gfxFont::Measure(const gfxTextRun *aTextRun,
|
|||
if (aBoundingBoxType == TIGHT_HINTED_OUTLINE_EXTENTS &&
|
||||
mAntialiasOption != kAntialiasNone) {
|
||||
if (!mNonAAFont) {
|
||||
mNonAAFont.reset(CopyWithAntialiasOption(kAntialiasNone));
|
||||
mNonAAFont = Move(CopyWithAntialiasOption(kAntialiasNone));
|
||||
}
|
||||
// if font subclass doesn't implement CopyWithAntialiasOption(),
|
||||
// it will return null and we'll proceed to use the existing font
|
||||
|
|
|
@ -1430,7 +1430,8 @@ public:
|
|||
|
||||
virtual cairo_scaled_font_t* GetCairoScaledFont() { return mScaledFont; }
|
||||
|
||||
virtual gfxFont* CopyWithAntialiasOption(AntialiasOption anAAOption) {
|
||||
virtual mozilla::UniquePtr<gfxFont>
|
||||
CopyWithAntialiasOption(AntialiasOption anAAOption) {
|
||||
// platforms where this actually matters should override
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -72,11 +72,11 @@ gfxGDIFont::~gfxGDIFont()
|
|||
delete mMetrics;
|
||||
}
|
||||
|
||||
gfxFont*
|
||||
UniquePtr<gfxFont>
|
||||
gfxGDIFont::CopyWithAntialiasOption(AntialiasOption anAAOption)
|
||||
{
|
||||
return new gfxGDIFont(static_cast<GDIFontEntry*>(mFontEntry.get()),
|
||||
&mStyle, mNeedsBold, anAAOption);
|
||||
auto entry = static_cast<GDIFontEntry*>(mFontEntry.get());
|
||||
return MakeUnique<gfxGDIFont>(entry, &mStyle, mNeedsBold, anAAOption);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
uint16_t aOrientation) override;
|
||||
|
||||
/* required for MathML to suppress effects of ClearType "padding" */
|
||||
virtual gfxFont*
|
||||
mozilla::UniquePtr<gfxFont>
|
||||
CopyWithAntialiasOption(AntialiasOption anAAOption) override;
|
||||
|
||||
// If the font has a cmap table, we handle it purely with harfbuzz;
|
||||
|
|
Загрузка…
Ссылка в новой задаче