[Libreoffice-commits] core.git: vcl/inc vcl/quartz
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Oct 6 16:30:37 UTC 2018
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 <glogow at fbihome.de>
AuthorDate: Thu Oct 4 15:54:53 2018 +0000
Commit: Jan-Marek Glogowski <glogow at 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 <glogow at 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;
}
More information about the Libreoffice-commits
mailing list