diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-27 15:37:39 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-30 11:42:49 +0100 |
commit | 7b0f2ee441b0cbcb88f3020df40c49e7cd6f9fb1 (patch) | |
tree | 2382b66e9a92907934e891cded6497c8ea7186ef /vcl/quartz | |
parent | a4b60b78ea36d55a2abf0e5efccd8530568d2209 (diff) |
Rely on the font instance of the glyph
The FreetypeFont might already have released the font instance of
the glyph, but the glyphs font instance must still be valid, so
use this instead to cache glyph bound rect.
For whatever reason the Windows compiler doesn't accept inline
functions in the GlyphItem struct and wants to export them in
the DLL, even when declared VCL_DLLPRIVATE, so this just uses
static inlines as a workaround.
Change-Id: I4539d91a846a54a05f9648638494e1e99f704b0a
Reviewed-on: https://gerrit.libreoffice.org/62425
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 5d3ca2c8e083..1425f7d1617b 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -34,6 +34,7 @@ #endif #include <fontinstance.hxx> #include <fontattributes.hxx> +#include <impglyphitem.hxx> #include <PhysicalFontCollection.hxx> #include <quartz/salgdi.h> #include <quartz/utils.h> @@ -139,7 +140,8 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) { - if (GetCachedGlyphBoundRect(rGlyph.m_aGlyphId, rRect)) + assert(this == rGlyph.m_pFontInstance); + if (::GetCachedGlyphBoundRect(rGlyph, rRect)) return true; CGGlyph nCGGlyph = rGlyph.m_aGlyphId; @@ -159,7 +161,8 @@ 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.m_aGlyphId, rRect); + + ::CacheGlyphBoundRect(rGlyph, rRect); return true; } |