summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-23 11:56:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-23 15:37:33 +0000
commit944f8f8adf6e85b028f03e37f68f067a4eeaafff (patch)
tree621a6390f61c6fbd91138a24f71cc057bc233262
parent6f1ae11761ddfa2f928254ff51f1860155f670a4 (diff)
fold GetGlyphMetric and GetGlyphData together
Change-Id: I12ea240bab223fb62a58a14fecc821e9075fa59e Reviewed-on: https://gerrit.libreoffice.org/31114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/unx/glyphcache.hxx4
-rw-r--r--vcl/unx/generic/glyphs/glyphcache.cxx6
2 files changed, 4 insertions, 6 deletions
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 1e2d57c54d5b..366bd2a5d0fb 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -168,8 +168,7 @@ public:
const FontCharMapRef GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &) const;
- const GlyphMetric& GetGlyphMetric( sal_GlyphId aGlyphId )
- { return GetGlyphData( aGlyphId ).GetMetric(); }
+ const GlyphMetric& GetGlyphMetric(sal_GlyphId aGlyphId);
#if ENABLE_GRAPHITE
GraphiteFaceWrapper* GetGraphiteFace() const;
@@ -201,7 +200,6 @@ private:
void ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_* ) const;
void ApplyGSUB( const FontSelectPattern& );
- GlyphData& GetGlyphData( sal_GlyphId );
ServerFontLayoutEngine* GetLayoutEngine();
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
index c1b4a4e80c63..de4bb9666975 100644
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
@@ -304,14 +304,14 @@ long FreetypeFont::Release() const
return --mnRefCount;
}
-GlyphData& FreetypeFont::GetGlyphData( sal_GlyphId aGlyphId )
+const GlyphMetric& FreetypeFont::GetGlyphMetric(sal_GlyphId aGlyphId)
{
// usually the GlyphData is cached
GlyphList::iterator it = maGlyphList.find( aGlyphId );
if( it != maGlyphList.end() ) {
GlyphData& rGlyphData = it->second;
GlyphCache::GetInstance().UsingGlyph( *this, rGlyphData );
- return rGlyphData;
+ return rGlyphData.GetMetric();
}
// sometimes not => we need to create and initialize it ourselves
@@ -319,7 +319,7 @@ GlyphData& FreetypeFont::GetGlyphData( sal_GlyphId aGlyphId )
mnBytesUsed += sizeof( GlyphData );
InitGlyphData( aGlyphId, rGlyphData );
GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData );
- return rGlyphData;
+ return rGlyphData.GetMetric();
}
void FreetypeFont::GarbageCollect( long nMinLruIndex )