vcl/inc/quartz/salgdi.h | 2 +- vcl/quartz/ctfonts.cxx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit 2f182faaf08542e381a1aee4544b47c4cd7c0b92 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Thu Oct 4 15:54:53 2018 +0000 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Sat Oct 6 18:30:15 2018 +0200 OSX use font cache based glyph rect cache Change-Id: Ia9bf718f1158c68971511688fe5af3e335d841ba Reviewed-on: https://gerrit.libreoffice.org/61386 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 24b5268493de..0fb20bb490cc 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -85,7 +85,7 @@ public: ~CoreTextStyle() override; void GetFontMetric( ImplFontMetricDataRef const & ); - bool GetGlyphBoundRect(const GlyphItem&, tools::Rectangle&) const; + bool GetGlyphBoundRect(const GlyphItem&, tools::Rectangle&); bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) const; CFMutableDictionaryRef GetStyleDict( void ) const { return mpStyleDict; } diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 6ceec8a0295d..65b3a85f5a43 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -137,8 +137,11 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) rxFontMetric->SetMinKashida(GetKashidaWidth()); } -bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) const +bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) { + if (GetCachedGlyphBoundRect(rGlyph.maGlyphId, rRect)) + return true; + CGGlyph nCGGlyph = rGlyph.maGlyphId; CTFontRef aCTFontRef = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName )); @@ -156,6 +159,7 @@ bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& long xMax = ceil(aCGRect.origin.x + aCGRect.size.width); long yMax = ceil(aCGRect.origin.y + aCGRect.size.height); rRect = tools::Rectangle(xMin, -yMax, xMax, -yMin); + CacheGlyphBoundRect(rGlyph.maGlyphId, rRect); return true; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits