mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Issue #2191 - Remove redundant CairoScaledFont accessor from gfxFont subclasses.
Backported from Mozilla bug 1385029.
This commit is contained in:
parent
a35ce5e5e1
commit
b721b6257f
4 changed files with 6 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ gfxFT2FontBase::GetGlyph(uint32_t aCharCode)
|
|||
// lightweight cache, which is stored on the cairo_font_face_t.
|
||||
|
||||
cairo_font_face_t *face =
|
||||
cairo_scaled_font_get_font_face(CairoScaledFont());
|
||||
cairo_scaled_font_get_font_face(GetCairoScaledFont());
|
||||
|
||||
if (cairo_font_face_status(face) != CAIRO_STATUS_SUCCESS)
|
||||
return 0;
|
||||
|
|
@ -105,7 +105,7 @@ gfxFT2FontBase::GetGlyphExtents(uint32_t aGlyph, cairo_text_extents_t* aExtents)
|
|||
// so caching only the advance could allow many requests to be cached with
|
||||
// little memory use. Ideally this cache would be merged with
|
||||
// gfxGlyphExtents.
|
||||
cairo_scaled_font_glyph_extents(CairoScaledFont(), glyphs, 1, aExtents);
|
||||
cairo_scaled_font_glyph_extents(GetCairoScaledFont(), glyphs, 1, aExtents);
|
||||
}
|
||||
|
||||
const gfxFont::Metrics&
|
||||
|
|
@ -186,7 +186,7 @@ gfxFT2FontBase::SetupCairoFont(DrawTarget* aDrawTarget)
|
|||
// for the target can be different from the scaled_font passed to
|
||||
// cairo_set_scaled_font. (Unfortunately we have measured only for an
|
||||
// identity ctm.)
|
||||
cairo_scaled_font_t *cairoFont = CairoScaledFont();
|
||||
cairo_scaled_font_t *cairoFont = GetCairoScaledFont();
|
||||
|
||||
if (cairo_scaled_font_status(cairoFont) != CAIRO_STATUS_SUCCESS) {
|
||||
// Don't cairo_set_scaled_font as that would propagate the error to
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ public:
|
|||
virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget,
|
||||
uint16_t aGID) override;
|
||||
|
||||
cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
|
||||
virtual bool SetupCairoFont(DrawTarget* aDrawTarget) override;
|
||||
|
||||
virtual FontType GetType() const override { return FONT_TYPE_FT2; }
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ class gfxFT2LockedFace {
|
|||
public:
|
||||
explicit gfxFT2LockedFace(gfxFT2FontBase *aFont) :
|
||||
mGfxFont(aFont),
|
||||
mFace(cairo_ft_scaled_font_lock_face(aFont->CairoScaledFont()))
|
||||
mFace(cairo_ft_scaled_font_lock_face(aFont->GetCairoScaledFont()))
|
||||
{ }
|
||||
~gfxFT2LockedFace()
|
||||
{
|
||||
if (mFace) {
|
||||
cairo_ft_scaled_font_unlock_face(mGfxFont->CairoScaledFont());
|
||||
cairo_ft_scaled_font_unlock_face(mGfxFont->GetCairoScaledFont());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ public:
|
|||
|
||||
HFONT GetHFONT() { return mFont; }
|
||||
|
||||
cairo_font_face_t *CairoFontFace() { return mFontFace; }
|
||||
cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; }
|
||||
cairo_font_face_t* CairoFontFace() { return mFontFace; }
|
||||
|
||||
/* overrides for the pure virtual methods in gfxFont */
|
||||
virtual uint32_t GetSpaceGlyph() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue