summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@aol.com>2023-04-05 18:47:25 +0800
committerJob Bautista <jobbautista9@protonmail.com>2023-04-05 21:22:18 +0800
commitc85b510dbba8a9cd08aaec431cbb4f9feeeba261 (patch)
tree44c5fd5931cedf21ebad077856fffa84462a0193 /gfx
parent4af61863f3da2e6f8951854e4343e6898e1e86f8 (diff)
downloaduxp-c85b510dbba8a9cd08aaec431cbb4f9feeeba261.tar.gz
Issue #2191 - Remove redundant CairoScaledFont accessor from gfxFont subclasses.
Backported from Mozilla bug 1385029.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/thebes/gfxFT2FontBase.cpp6
-rw-r--r--gfx/thebes/gfxFT2FontBase.h1
-rw-r--r--gfx/thebes/gfxFT2Utils.h4
-rw-r--r--gfx/thebes/gfxGDIFont.h3
4 files changed, 6 insertions, 8 deletions
diff --git a/gfx/thebes/gfxFT2FontBase.cpp b/gfx/thebes/gfxFT2FontBase.cpp
index 241f28f638..8a450d0ab7 100644
--- a/gfx/thebes/gfxFT2FontBase.cpp
+++ b/gfx/thebes/gfxFT2FontBase.cpp
@@ -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
diff --git a/gfx/thebes/gfxFT2FontBase.h b/gfx/thebes/gfxFT2FontBase.h
index 498c74ff97..ea40bdb520 100644
--- a/gfx/thebes/gfxFT2FontBase.h
+++ b/gfx/thebes/gfxFT2FontBase.h
@@ -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; }
diff --git a/gfx/thebes/gfxFT2Utils.h b/gfx/thebes/gfxFT2Utils.h
index 35958bbf79..cabbe3874f 100644
--- a/gfx/thebes/gfxFT2Utils.h
+++ b/gfx/thebes/gfxFT2Utils.h
@@ -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());
}
}
diff --git a/gfx/thebes/gfxGDIFont.h b/gfx/thebes/gfxGDIFont.h
index 9d8ac95524..cf2a49e226 100644
--- a/gfx/thebes/gfxGDIFont.h
+++ b/gfx/thebes/gfxGDIFont.h
@@ -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;