diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-04 15:54:53 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-06 18:30:15 +0200 |
commit | 2f182faaf08542e381a1aee4544b47c4cd7c0b92 (patch) | |
tree | e7212480971dcd587f650b365eb7d748df559fcf /vcl/quartz/ctfonts.cxx | |
parent | 16a338e173083954a9932a3a4005f172309c784e (diff) |
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 <glogow@fbihome.de>
Diffstat (limited to 'vcl/quartz/ctfonts.cxx')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |