mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 02:09:28 +00:00
Bug 1516677. Remove unused drawtarget parameter. r=jfkthame
With bug 1509358 having landed we don't need a draw target in a bunch of places. This removes it from those places. Differential Revision: https://phabricator.services.mozilla.com/D15481 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e25810f1d4
commit
6bf19bfac4
@ -546,7 +546,7 @@ bool gfxDWriteFont::ProvidesGlyphWidths() const {
|
||||
!mStyle.variationSettings.IsEmpty());
|
||||
}
|
||||
|
||||
int32_t gfxDWriteFont::GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) {
|
||||
int32_t gfxDWriteFont::GetGlyphWidth(uint16_t aGID) {
|
||||
if (!mGlyphWidths) {
|
||||
mGlyphWidths = MakeUnique<nsDataHashtable<nsUint32HashKey, int32_t>>(128);
|
||||
}
|
||||
|
@ -57,8 +57,7 @@ class gfxDWriteFont : public gfxFont {
|
||||
|
||||
virtual bool ProvidesGlyphWidths() const override;
|
||||
|
||||
virtual int32_t GetGlyphWidth(DrawTarget &aDrawTarget,
|
||||
uint16_t aGID) override;
|
||||
virtual int32_t GetGlyphWidth(uint16_t aGID) override;
|
||||
|
||||
virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes *aSizes) const override;
|
||||
|
@ -544,7 +544,7 @@ bool gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID, int32_t* aAdvance) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t gfxFT2FontBase::GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) {
|
||||
int32_t gfxFT2FontBase::GetGlyphWidth(uint16_t aGID) {
|
||||
if (!mGlyphWidths) {
|
||||
mGlyphWidths =
|
||||
mozilla::MakeUnique<nsDataHashtable<nsUint32HashKey, int32_t>>(128);
|
||||
|
@ -29,8 +29,7 @@ class gfxFT2FontBase : public gfxFont {
|
||||
virtual uint32_t GetGlyph(uint32_t unicode,
|
||||
uint32_t variation_selector) override;
|
||||
virtual bool ProvidesGlyphWidths() const override { return true; }
|
||||
virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget,
|
||||
uint16_t aGID) override;
|
||||
virtual int32_t GetGlyphWidth(uint16_t aGID) override;
|
||||
|
||||
virtual bool SetupCairoFont(DrawTarget* aDrawTarget) override;
|
||||
|
||||
|
@ -885,7 +885,7 @@ gfxFloat gfxFont::GetGlyphHAdvance(DrawTarget* aDrawTarget, uint16_t aGID) {
|
||||
return 0;
|
||||
}
|
||||
if (ProvidesGlyphWidths()) {
|
||||
return GetGlyphWidth(*aDrawTarget, aGID) / 65536.0;
|
||||
return GetGlyphWidth(aGID) / 65536.0;
|
||||
}
|
||||
if (mFUnitsConvFactor < 0.0f) {
|
||||
GetMetrics(eHorizontal);
|
||||
|
@ -1940,7 +1940,7 @@ class gfxFont {
|
||||
|
||||
// The return value is interpreted as a horizontal advance in 16.16 fixed
|
||||
// point format.
|
||||
virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) {
|
||||
virtual int32_t GetGlyphWidth(uint16_t aGID) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -483,7 +483,7 @@ uint32_t gfxGDIFont::GetGlyph(uint32_t aUnicode, uint32_t aVarSelector) {
|
||||
return glyph;
|
||||
}
|
||||
|
||||
int32_t gfxGDIFont::GetGlyphWidth(DrawTarget &aDrawTarget, uint16_t aGID) {
|
||||
int32_t gfxGDIFont::GetGlyphWidth(uint16_t aGID) {
|
||||
if (!mGlyphWidths) {
|
||||
mGlyphWidths = MakeUnique<nsDataHashtable<nsUint32HashKey, int32_t>>(128);
|
||||
}
|
||||
|
@ -57,8 +57,7 @@ class gfxGDIFont : public gfxFont {
|
||||
virtual bool ProvidesGlyphWidths() const override { return true; }
|
||||
|
||||
// get hinted glyph width in pixels as 16.16 fixed-point value
|
||||
virtual int32_t GetGlyphWidth(DrawTarget &aDrawTarget,
|
||||
uint16_t aGID) override;
|
||||
virtual int32_t GetGlyphWidth(uint16_t aGID) override;
|
||||
|
||||
virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
||||
FontCacheSizes *aSizes) const;
|
||||
|
@ -33,7 +33,6 @@ gfxGraphiteShaper::gfxGraphiteShaper(gfxFont *aFont)
|
||||
mGrFace(mFont->GetFontEntry()->GetGrFace()),
|
||||
mGrFont(nullptr),
|
||||
mFallbackToSmallCaps(false) {
|
||||
mCallbackData.mDrawTarget = nullptr;
|
||||
mCallbackData.mFont = aFont;
|
||||
}
|
||||
|
||||
@ -47,7 +46,7 @@ gfxGraphiteShaper::~gfxGraphiteShaper() {
|
||||
/*static*/ float gfxGraphiteShaper::GrGetAdvance(const void *appFontHandle,
|
||||
uint16_t glyphid) {
|
||||
const CallbackData *cb = static_cast<const CallbackData *>(appFontHandle);
|
||||
return FixedToFloat(cb->mFont->GetGlyphWidth(*cb->mDrawTarget, glyphid));
|
||||
return FixedToFloat(cb->mFont->GetGlyphWidth(glyphid));
|
||||
}
|
||||
|
||||
static inline uint32_t MakeGraphiteLangTag(uint32_t aTag) {
|
||||
@ -85,8 +84,6 @@ bool gfxGraphiteShaper::ShapeText(DrawTarget *aDrawTarget,
|
||||
return false;
|
||||
}
|
||||
|
||||
mCallbackData.mDrawTarget = aDrawTarget;
|
||||
|
||||
const gfxFontStyle *style = mFont->GetStyle();
|
||||
|
||||
if (!mGrFont) {
|
||||
|
@ -41,9 +41,6 @@ class gfxGraphiteShaper : public gfxFontShaper {
|
||||
// mFont is a pointer to the font that owns this shaper, so it will
|
||||
// remain valid throughout our lifetime
|
||||
gfxFont *MOZ_NON_OWNING_REF mFont;
|
||||
// initialized to a DrawTarget owned by our caller on every call to
|
||||
// ShapeText
|
||||
mozilla::gfx::DrawTarget *MOZ_NON_OWNING_REF mDrawTarget;
|
||||
};
|
||||
|
||||
CallbackData mCallbackData;
|
||||
|
@ -357,7 +357,7 @@ hb_position_t gfxHarfBuzzShaper::HBGetGlyphHAdvance(hb_font_t *font,
|
||||
static_cast<const gfxHarfBuzzShaper::FontCallbackData *>(font_data);
|
||||
const gfxHarfBuzzShaper *shaper = fcd->mShaper;
|
||||
if (shaper->mUseFontGlyphWidths) {
|
||||
return shaper->GetFont()->GetGlyphWidth(*fcd->mDrawTarget, glyph);
|
||||
return shaper->GetFont()->GetGlyphWidth(glyph);
|
||||
}
|
||||
return shaper->GetGlyphHAdvance(glyph);
|
||||
}
|
||||
@ -400,14 +400,14 @@ hb_bool_t gfxHarfBuzzShaper::HBGetGlyphVOrigin(hb_font_t *font, void *font_data,
|
||||
void *user_data) {
|
||||
const gfxHarfBuzzShaper::FontCallbackData *fcd =
|
||||
static_cast<const gfxHarfBuzzShaper::FontCallbackData *>(font_data);
|
||||
fcd->mShaper->GetGlyphVOrigin(*fcd->mDrawTarget, glyph, x, y);
|
||||
fcd->mShaper->GetGlyphVOrigin(glyph, x, y);
|
||||
return true;
|
||||
}
|
||||
|
||||
void gfxHarfBuzzShaper::GetGlyphVOrigin(DrawTarget &aDT, hb_codepoint_t aGlyph,
|
||||
void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
|
||||
hb_position_t *aX,
|
||||
hb_position_t *aY) const {
|
||||
*aX = 0.5 * (mUseFontGlyphWidths ? mFont->GetGlyphWidth(aDT, aGlyph)
|
||||
*aX = 0.5 * (mUseFontGlyphWidths ? mFont->GetGlyphWidth(aGlyph)
|
||||
: GetGlyphHAdvance(aGlyph));
|
||||
|
||||
if (mVORGTable) {
|
||||
@ -1339,7 +1339,6 @@ bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
|
||||
return false;
|
||||
}
|
||||
|
||||
mCallbackData.mDrawTarget = aDrawTarget;
|
||||
mUseVerticalPresentationForms = false;
|
||||
|
||||
if (!Initialize()) {
|
||||
|
@ -23,9 +23,6 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
|
||||
*/
|
||||
struct FontCallbackData {
|
||||
gfxHarfBuzzShaper *mShaper;
|
||||
// initialized to a DrawTarget owned by our caller on every call to
|
||||
// ShapeText
|
||||
mozilla::gfx::DrawTarget *MOZ_NON_OWNING_REF mDrawTarget;
|
||||
};
|
||||
|
||||
bool Initialize();
|
||||
@ -48,8 +45,8 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
|
||||
|
||||
hb_position_t GetGlyphVAdvance(hb_codepoint_t glyph) const;
|
||||
|
||||
void GetGlyphVOrigin(mozilla::gfx::DrawTarget &aDT, hb_codepoint_t aGlyph,
|
||||
hb_position_t *aX, hb_position_t *aY) const;
|
||||
void GetGlyphVOrigin(hb_codepoint_t aGlyph, hb_position_t *aX,
|
||||
hb_position_t *aY) const;
|
||||
|
||||
// get harfbuzz horizontal advance in 16.16 fixed point format.
|
||||
static hb_position_t HBGetGlyphHAdvance(hb_font_t *font, void *font_data,
|
||||
|
@ -496,7 +496,7 @@ CTFontRef gfxMacFont::CreateCTFontFromCGFontWithVariations(
|
||||
return ctFont;
|
||||
}
|
||||
|
||||
int32_t gfxMacFont::GetGlyphWidth(DrawTarget &aDrawTarget, uint16_t aGID) {
|
||||
int32_t gfxMacFont::GetGlyphWidth(uint16_t aGID) {
|
||||
if (mVariationFont) {
|
||||
// Avoid a potential Core Text crash (bug 1450209) by using
|
||||
// CoreGraphics glyph advance API. This is inferior for 'sbix'
|
||||
|
@ -41,7 +41,7 @@ class gfxMacFont : public gfxFont {
|
||||
return mVariationFont || mFontEntry->HasFontTable(TRUETYPE_TAG('s', 'b', 'i', 'x'));
|
||||
}
|
||||
|
||||
int32_t GetGlyphWidth(DrawTarget &aDrawTarget, uint16_t aGID) override;
|
||||
int32_t GetGlyphWidth(uint16_t aGID) override;
|
||||
|
||||
already_AddRefed<mozilla::gfx::ScaledFont> GetScaledFont(
|
||||
mozilla::gfx::DrawTarget *aTarget) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user