Loading gfx/thebes/gfxDWriteFonts.cpp +29 −15 Original line number Diff line number Diff line Loading @@ -752,7 +752,8 @@ gfxFloat gfxDWriteFont::MeasureGlyphWidth(uint16_t aGlyph) { } bool gfxDWriteFont::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const { bool aTight) { MOZ_SEH_TRY { DWRITE_GLYPH_METRICS m; HRESULT hr = mFontFace->GetDesignGlyphMetrics(&aGID, 1, &m, FALSE); if (FAILED(hr)) { Loading @@ -770,6 +771,19 @@ bool gfxDWriteFont::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, *aBounds = bounds; return true; } MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { // Exception (e.g. disk i/o error) occurred when DirectWrite tried to use // the font resource; possibly a failing drive or similar hardware issue. // Mark the font as invalid, and wipe the fontEntry's charmap so that font // selection will skip it; we'll use a fallback font instead. mIsValid = false; GetFontEntry()->mCharacterMap = new gfxCharacterMap(); GetFontEntry()->mShmemCharacterMap = nullptr; gfxCriticalError() << "Exception occurred measuring glyph bounds for " << GetFontEntry()->Name().get(); } return false; } void gfxDWriteFont::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, FontCacheSizes* aSizes) const { Loading gfx/thebes/gfxDWriteFonts.h +1 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,7 @@ class gfxDWriteFont final : public gfxFont { int32_t GetGlyphWidth(uint16_t aGID) override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) override; void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf, FontCacheSizes* aSizes) const override; Loading gfx/thebes/gfxFT2FontBase.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -761,7 +761,7 @@ const gfxFT2FontBase::GlyphMetrics& gfxFT2FontBase::GetCachedGlyphMetrics( } bool gfxFT2FontBase::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const { bool aTight) { IntRect bounds; const GlyphMetrics& metrics = GetCachedGlyphMetrics(aGID, &bounds); if (!metrics.HasValidBounds()) { Loading gfx/thebes/gfxFT2FontBase.h +1 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,7 @@ class gfxFT2FontBase : public gfxFont { return GetCachedGlyphMetrics(aGID).mAdvance; } bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) override; FontType GetType() const override { return FONT_TYPE_FT2; } Loading gfx/thebes/gfxFont.h +1 −1 Original line number Diff line number Diff line Loading @@ -1989,7 +1989,7 @@ class gfxFont { virtual int32_t GetGlyphWidth(uint16_t aGID) { return -1; } virtual bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight = false) const { bool aTight = false) { return false; } Loading Loading
gfx/thebes/gfxDWriteFonts.cpp +29 −15 Original line number Diff line number Diff line Loading @@ -752,7 +752,8 @@ gfxFloat gfxDWriteFont::MeasureGlyphWidth(uint16_t aGlyph) { } bool gfxDWriteFont::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const { bool aTight) { MOZ_SEH_TRY { DWRITE_GLYPH_METRICS m; HRESULT hr = mFontFace->GetDesignGlyphMetrics(&aGID, 1, &m, FALSE); if (FAILED(hr)) { Loading @@ -770,6 +771,19 @@ bool gfxDWriteFont::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, *aBounds = bounds; return true; } MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { // Exception (e.g. disk i/o error) occurred when DirectWrite tried to use // the font resource; possibly a failing drive or similar hardware issue. // Mark the font as invalid, and wipe the fontEntry's charmap so that font // selection will skip it; we'll use a fallback font instead. mIsValid = false; GetFontEntry()->mCharacterMap = new gfxCharacterMap(); GetFontEntry()->mShmemCharacterMap = nullptr; gfxCriticalError() << "Exception occurred measuring glyph bounds for " << GetFontEntry()->Name().get(); } return false; } void gfxDWriteFont::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, FontCacheSizes* aSizes) const { Loading
gfx/thebes/gfxDWriteFonts.h +1 −2 Original line number Diff line number Diff line Loading @@ -57,8 +57,7 @@ class gfxDWriteFont final : public gfxFont { int32_t GetGlyphWidth(uint16_t aGID) override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) override; void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf, FontCacheSizes* aSizes) const override; Loading
gfx/thebes/gfxFT2FontBase.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -761,7 +761,7 @@ const gfxFT2FontBase::GlyphMetrics& gfxFT2FontBase::GetCachedGlyphMetrics( } bool gfxFT2FontBase::GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const { bool aTight) { IntRect bounds; const GlyphMetrics& metrics = GetCachedGlyphMetrics(aGID, &bounds); if (!metrics.HasValidBounds()) { Loading
gfx/thebes/gfxFT2FontBase.h +1 −2 Original line number Diff line number Diff line Loading @@ -60,8 +60,7 @@ class gfxFT2FontBase : public gfxFont { return GetCachedGlyphMetrics(aGID).mAdvance; } bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) const override; bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight) override; FontType GetType() const override { return FONT_TYPE_FT2; } Loading
gfx/thebes/gfxFont.h +1 −1 Original line number Diff line number Diff line Loading @@ -1989,7 +1989,7 @@ class gfxFont { virtual int32_t GetGlyphWidth(uint16_t aGID) { return -1; } virtual bool GetGlyphBounds(uint16_t aGID, gfxRect* aBounds, bool aTight = false) const { bool aTight = false) { return false; } Loading