diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-08 03:01:14 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-10 01:57:50 +0000 |
commit | bebee55d197176f009668628de0d9945c26af8ad (patch) | |
tree | e5e476f55f5e13e93540c475e2b34ff9a837384c /vcl | |
parent | b894104a0b02a9b074c76feb925389d7bee6a493 (diff) |
Use GlyphItem in more places
Change-Id: Ic0dd8c0311161271817eb9a3f454d00a319e43a8
Reviewed-on: https://gerrit.libreoffice.org/31814
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svptext.cxx | 8 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 8 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/textrender.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/unx/cairotextrender.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/unx/genpspgraphics.h | 4 | ||||
-rw-r--r-- | vcl/inc/unx/glyphcache.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 4 | ||||
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 10 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 12 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/font.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/generic/glyphs/glyphcache.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/print/genpspgraphics.cxx | 14 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 12 |
20 files changed, 70 insertions, 84 deletions
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 63a10f583cee..bdb97a97efc7 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -91,14 +91,14 @@ void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, m_aTextRenderImpl.GetGlyphWidths(pFont, bVertical, rWidths, rUnicodeEnc); } -bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool SvpSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) { - return m_aTextRenderImpl.GetGlyphBoundRect(aGlyphId, rRect); + return m_aTextRenderImpl.GetGlyphBoundRect(rGlyph, rRect); } -bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) +bool SvpSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rPolyPoly) { - return m_aTextRenderImpl.GetGlyphOutline(aGlyphId, rPolyPoly); + return m_aTextRenderImpl.GetGlyphOutline(rGlyph, rPolyPoly); } SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel ) diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index a8f33621643b..808347401d2c 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -159,8 +159,8 @@ public: bool bVertical, std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) override; - virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout( const CommonSalLayout& ) override; virtual bool supportsOperation( OutDevSupportType ) const override; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 6ea5bf3e444c..086266d05589 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -89,8 +89,8 @@ public: ~CoreTextStyle( void ); void GetFontMetric( ImplFontMetricDataRef& ) const; - bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const; - bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const; + bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) const; + bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) const; hb_font_t* GetHbFont() const { return mpHbFont; } void SetHbFont(hb_font_t* pHbFont) const { mpHbFont = pHbFont; } @@ -375,8 +375,8 @@ public: std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) override; - virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout( const CommonSalLayout& ) override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index ef228fa865b6..9ca24332903c 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -191,8 +191,8 @@ public: std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) = 0; - virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) = 0; - virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) = 0; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) = 0; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; virtual void DrawTextLayout( const CommonSalLayout& ) = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 9417345ea8c9..1b04725398ce 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -59,8 +59,8 @@ public: std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) = 0; - virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0; - virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) = 0; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; virtual void DrawTextLayout(const CommonSalLayout&) = 0; #if ENABLE_CAIRO_CANVAS diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx index 5fab64ae2b07..1cdf405f1dc9 100644 --- a/vcl/inc/unx/cairotextrender.hxx +++ b/vcl/inc/unx/cairotextrender.hxx @@ -75,8 +75,8 @@ public: std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) override; - virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout(const CommonSalLayout&) override; #if ENABLE_CAIRO_CANVAS diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index 1dcb7ab18be3..721efd56245c 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -115,8 +115,8 @@ public: bool bVertical, std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) override; - virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout( const CommonSalLayout& ) override; virtual bool supportsOperation( OutDevSupportType ) const override; diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index 65afd4b3ea81..bf9cf3c43b93 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -157,9 +157,9 @@ public: const FontCharMapRef GetFontCharMap() const; bool GetFontCapabilities(vcl::FontCapabilities &) const; - const GlyphMetric& GetGlyphMetric(sal_GlyphId aGlyphId); + const GlyphMetric& GetGlyphMetric(const GlyphItem& rGlyph); - bool GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& ) const; + bool GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon&) const; bool GetAntialiasAdvice() const; hb_font_t* GetHbFont() { return mpHbFont; } void SetHbFont( hb_font_t* pHbFont ) { mpHbFont = pHbFont; } @@ -175,7 +175,7 @@ private: long Release() const; sal_uLong GetByteCount() const { return mnBytesUsed; } - void InitGlyphData( sal_GlyphId, GlyphData& ) const; + void InitGlyphData(const GlyphItem&, GlyphData&) const; void GarbageCollect( long ); void ReleaseFromGarbageCollect(); diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index b3de804c5089..5eb9172d0876 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -140,8 +140,8 @@ public: std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) override; - virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout( const CommonSalLayout& ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 198c61c3ce3e..8a493d7dc72b 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -377,8 +377,8 @@ public: Ucs2UIntMap& rUnicodeEnc ) override; int GetMinKashidaWidth(); - virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) override; - virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) override; + virtual bool GetGlyphBoundRect(const GlyphItem&, Rectangle&) override; + virtual bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) override; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) override; virtual void DrawTextLayout( const CommonSalLayout& ) override; diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 7677a0403d40..300ee4dafe3d 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -152,9 +152,9 @@ SAL_WNODEPRECATED_DECLARATIONS_POP } } -bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const +bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect ) const { - CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; + CGGlyph nCGGlyph = rGlyph.maGlyphId & GF_IDXMASK; CTFontRef aCTFontRef = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName )); SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation @@ -163,7 +163,7 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1); // Apply font rotation to non-upright glyphs. - if (mfFontRotation && !(aGlyphId & GF_ROTMASK)) + if (mfFontRotation && !(rGlyph.maGlyphId & GF_ROTMASK)) aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation)); rRect.Left() = lrint( aCGRect.origin.x ); @@ -225,11 +225,11 @@ static void MyCGPathApplierFunc( void* pData, const CGPathElement* pElement ) } } -bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rResult ) const +bool CoreTextStyle::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rResult) const { rResult.clear(); - CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; + CGGlyph nCGGlyph = rGlyph.maGlyphId & GF_IDXMASK; CTFontRef pCTFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName )); CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr ); if (!xPath) diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 4b3a63ac140d..c593b8887de0 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -382,23 +382,23 @@ bool AquaSalGraphics::AddTempDevFont( PhysicalFontCollection*, return ::AddTempDevFont(rFontFileURL); } -bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) +bool AquaSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rPolyPoly) { - const int nFallbackLevel = aGlyphId >> GF_FONTSHIFT; + const int nFallbackLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if (nFallbackLevel < MAX_FALLBACK && mpTextStyle[nFallbackLevel]) { - const bool bRC = mpTextStyle[nFallbackLevel]->GetGlyphOutline(aGlyphId, rPolyPoly); + const bool bRC = mpTextStyle[nFallbackLevel]->GetGlyphOutline(rGlyph, rPolyPoly); return bRC; } return false; } -bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool AquaSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect ) { - const int nFallbackLevel = aGlyphId >> GF_FONTSHIFT; + const int nFallbackLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if (nFallbackLevel < MAX_FALLBACK && mpTextStyle[nFallbackLevel]) { - const bool bRC = mpTextStyle[nFallbackLevel]->GetGlyphBoundRect(aGlyphId, rRect); + const bool bRC = mpTextStyle[nFallbackLevel]->GetGlyphBoundRect(rGlyph, rRect); return bRC; } return false; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 25c1600251da..6f3b082e1929 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -675,7 +675,7 @@ bool SalLayout::GetOutline( SalGraphics& rSalGraphics, while (GetNextGlyphs(1, &pGlyph, aPos, nStart)) { // get outline of individual glyph, ignoring "empty" glyphs - bool bSuccess = rSalGraphics.GetGlyphOutline(pGlyph->maGlyphId, aGlyphOutline); + bool bSuccess = rSalGraphics.GetGlyphOutline(*pGlyph, aGlyphOutline); bAllOk &= bSuccess; bOneOk |= bSuccess; // only add non-empty outlines @@ -707,7 +707,7 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRect ) cons while (GetNextGlyphs(1, &pGlyph, aPos, nStart)) { // get bounding rectangle of individual glyph - if (rSalGraphics.GetGlyphBoundRect(pGlyph->maGlyphId, aRectangle)) + if (rSalGraphics.GetGlyphBoundRect(*pGlyph, aRectangle)) { // merge rectangle aRectangle += aPos; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 71d3f21574b2..3820d428cf46 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1300,7 +1300,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) int nStart = 0; while (rSalLayout.GetNextGlyphs(1, &pGlyph, aOutPoint, nStart)) { - if (!mpGraphics->GetGlyphBoundRect(pGlyph->maGlyphId, aRectangle ) ) + if (!mpGraphics->GetGlyphBoundRect(*pGlyph, aRectangle ) ) continue; if (!SalLayout::IsSpacingGlyph(pGlyph->maGlyphId)) diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 501d3998a9da..3d7ca1547eb5 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -430,9 +430,9 @@ void CairoTextRender::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nF mpFreetypeFont[nFallbackLevel]->GetFontMetric(rxFontMetric); } -bool CairoTextRender::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool CairoTextRender::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) { - const int nLevel = aGlyphId >> GF_FONTSHIFT; + const int nLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) return false; @@ -440,8 +440,7 @@ bool CairoTextRender::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect if( !pSF ) return false; - aGlyphId &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric(aGlyphId); + const GlyphMetric& rGM = pSF->GetGlyphMetric(rGlyph); Rectangle aRect( rGM.GetOffset(), rGM.GetSize() ); if ( pSF->mnCos != 0x10000 && pSF->mnSin != 0 ) @@ -460,10 +459,10 @@ bool CairoTextRender::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect return true; } -bool CairoTextRender::GetGlyphOutline( sal_GlyphId aGlyphId, +bool CairoTextRender::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rPolyPoly ) { - const int nLevel = aGlyphId >> GF_FONTSHIFT; + const int nLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) return false; @@ -471,8 +470,7 @@ bool CairoTextRender::GetGlyphOutline( sal_GlyphId aGlyphId, if( !pSF ) return false; - aGlyphId &= GF_IDXMASK; - if( pSF->GetGlyphOutline( aGlyphId, rPolyPoly ) ) + if( pSF->GetGlyphOutline(rGlyph, rPolyPoly)) return true; return false; diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx index 8379c0cca3ee..37a3846d7d23 100644 --- a/vcl/unx/generic/gdi/font.cxx +++ b/vcl/unx/generic/gdi/font.cxx @@ -106,15 +106,15 @@ X11SalGraphics::GetFontMetric( ImplFontMetricDataRef &rxFontMetric, int nFallbac mxTextRenderImpl->GetFontMetric(rxFontMetric, nFallbackLevel); } -bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool X11SalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) { - return mxTextRenderImpl->GetGlyphBoundRect(aGlyphId, rRect); + return mxTextRenderImpl->GetGlyphBoundRect(rGlyph, rRect); } -bool X11SalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, +bool X11SalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rPolyPoly ) { - return mxTextRenderImpl->GetGlyphOutline(aGlyphId, rPolyPoly); + return mxTextRenderImpl->GetGlyphOutline(rGlyph, rPolyPoly); } SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel ) diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 36b262fd3e29..2e62abe6cbce 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -627,12 +627,6 @@ void FreetypeFont::GetFontMetric(ImplFontMetricDataRef& rxTo) const } -static inline void SplitGlyphFlags(sal_GlyphId& rGlyphId, int& nGlyphFlags) -{ - nGlyphFlags = rGlyphId & GF_FLAGMASK; - rGlyphId &= GF_IDXMASK; -} - void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) const { // shortcut most common case @@ -696,14 +690,13 @@ void FreetypeFont::ApplyGlyphTransform( int nGlyphFlags, FT_Glyph pGlyphFT ) con } } -void FreetypeFont::InitGlyphData( sal_GlyphId aGlyphId, GlyphData& rGD ) const +void FreetypeFont::InitGlyphData(const GlyphItem& rGlyph, GlyphData& rGD ) const { FT_Activate_Size( maSizeFT ); - int nGlyphFlags; - SplitGlyphFlags(aGlyphId, nGlyphFlags ); + int nGlyphFlags = rGlyph.maGlyphId & GF_FLAGMASK;; - FT_Error rc = FT_Load_Glyph(maFaceFT, aGlyphId, mnLoadFlags); + FT_Error rc = FT_Load_Glyph(maFaceFT, rGlyph.maGlyphId & GF_IDXMASK, mnLoadFlags); if( rc != FT_Err_Ok ) { @@ -1001,7 +994,7 @@ static int FT_cubic_to( const FT_Vector* p1, const FT_Vector* p2, const FT_Vecto } // extern "C" -bool FreetypeFont::GetGlyphOutline( sal_GlyphId aGlyphId, +bool FreetypeFont::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rB2DPolyPoly ) const { if( maSizeFT ) @@ -1009,8 +1002,7 @@ bool FreetypeFont::GetGlyphOutline( sal_GlyphId aGlyphId, rB2DPolyPoly.clear(); - int nGlyphFlags; - SplitGlyphFlags(aGlyphId, nGlyphFlags); + int nGlyphFlags = rGlyph.maGlyphId & GF_FLAGMASK;; FT_Int nLoadFlags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_TRANSFORM; @@ -1019,7 +1011,7 @@ bool FreetypeFont::GetGlyphOutline( sal_GlyphId aGlyphId, nLoadFlags |= FT_LOAD_TARGET_LIGHT; #endif - FT_Error rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags ); + FT_Error rc = FT_Load_Glyph(maFaceFT, rGlyph.maGlyphId & GF_IDXMASK, nLoadFlags); if( rc != FT_Err_Ok ) return false; diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx index 3cece786e7a7..b41f7c08c376 100644 --- a/vcl/unx/generic/glyphs/glyphcache.cxx +++ b/vcl/unx/generic/glyphs/glyphcache.cxx @@ -304,10 +304,10 @@ long FreetypeFont::Release() const return --mnRefCount; } -const GlyphMetric& FreetypeFont::GetGlyphMetric(sal_GlyphId aGlyphId) +const GlyphMetric& FreetypeFont::GetGlyphMetric(const GlyphItem& rGlyph) { // usually the GlyphData is cached - GlyphList::iterator it = maGlyphList.find( aGlyphId ); + GlyphList::iterator it = maGlyphList.find(rGlyph.maGlyphId & GF_IDXMASK); if( it != maGlyphList.end() ) { GlyphData& rGlyphData = it->second; GlyphCache::GetInstance().UsingGlyph( *this, rGlyphData ); @@ -315,9 +315,9 @@ const GlyphMetric& FreetypeFont::GetGlyphMetric(sal_GlyphId aGlyphId) } // sometimes not => we need to create and initialize it ourselves - GlyphData& rGlyphData = maGlyphList[ aGlyphId ]; + GlyphData& rGlyphData = maGlyphList[rGlyph.maGlyphId & GF_IDXMASK]; mnBytesUsed += sizeof( GlyphData ); - InitGlyphData( aGlyphId, rGlyphData ); + InitGlyphData(rGlyph, rGlyphData); GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData ); return rGlyphData.GetMetric(); } diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 213874d84e3e..f0859eb11f1d 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -760,9 +760,9 @@ void GenPspGraphics::GetFontMetric(ImplFontMetricDataRef& rxFontMetric, int nFal m_pFreetypeFont[nFallbackLevel]->GetFontMetric(rxFontMetric); } -bool GenPspGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool GenPspGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) { - const int nLevel = aGlyphId >> GF_FONTSHIFT; + const int nLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) return false; @@ -770,16 +770,15 @@ bool GenPspGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) if( !pSF ) return false; - aGlyphId &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric( aGlyphId ); + const GlyphMetric& rGM = pSF->GetGlyphMetric(rGlyph); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return true; } -bool GenPspGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, +bool GenPspGraphics::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rB2DPolyPoly ) { - const int nLevel = aGlyphId >> GF_FONTSHIFT; + const int nLevel = rGlyph.maGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) return false; @@ -787,8 +786,7 @@ bool GenPspGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, if( !pSF ) return false; - aGlyphId &= GF_IDXMASK; - if( pSF->GetGlyphOutline( aGlyphId, rB2DPolyPoly ) ) + if (pSF->GetGlyphOutline(rGlyph, rB2DPolyPoly)) return true; return false; diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index fef9bbf27723..30f22e684283 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1354,7 +1354,7 @@ void WinSalGraphics::ClearDevFontCache() //anything to do here ? } -bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) +bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, Rectangle& rRect) { HDC hDC = getHDC(); @@ -1365,12 +1365,11 @@ bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) UINT nGGOFlags = GGO_METRICS; nGGOFlags |= GGO_GLYPH_INDEX; - aGlyphId &= GF_IDXMASK; GLYPHMETRICS aGM; aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0; aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0; - DWORD nSize = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, &aGM, 0, nullptr, &aMat ); + DWORD nSize = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId & GF_IDXMASK, nGGOFlags, &aGM, 0, nullptr, &aMat); if( nSize == GDI_ERROR ) return false; @@ -1383,7 +1382,7 @@ bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) return true; } -bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, +bool WinSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, basegfx::B2DPolyPolygon& rB2DPolyPoly ) { rB2DPolyPoly.clear(); @@ -1397,17 +1396,16 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, UINT nGGOFlags = GGO_NATIVE; nGGOFlags |= GGO_GLYPH_INDEX; - aGlyphId &= GF_IDXMASK; GLYPHMETRICS aGlyphMetrics; - const DWORD nSize1 = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, &aGlyphMetrics, 0, nullptr, &aMat ); + const DWORD nSize1 = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId & GF_IDXMASK, nGGOFlags, &aGlyphMetrics, 0, nullptr, &aMat); if( !nSize1 ) // blank glyphs are ok return true; else if( nSize1 == GDI_ERROR ) return false; BYTE* pData = new BYTE[ nSize1 ]; - const DWORD nSize2 = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, + const DWORD nSize2 = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId & GF_IDXMASK, nGGOFlags, &aGlyphMetrics, nSize1, pData, &aMat ); if( nSize1 != nSize2 ) |