Kaydet (Commit) 944f8f8a authored tarafından Caolán McNamara's avatar Caolán McNamara

fold GetGlyphMetric and GetGlyphData together

Change-Id: I12ea240bab223fb62a58a14fecc821e9075fa59e
Reviewed-on: https://gerrit.libreoffice.org/31114Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6f1ae117
...@@ -168,8 +168,7 @@ public: ...@@ -168,8 +168,7 @@ public:
const FontCharMapRef GetFontCharMap() const; const FontCharMapRef GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &) const; bool GetFontCapabilities(vcl::FontCapabilities &) const;
const GlyphMetric& GetGlyphMetric( sal_GlyphId aGlyphId ) const GlyphMetric& GetGlyphMetric(sal_GlyphId aGlyphId);
{ return GetGlyphData( aGlyphId ).GetMetric(); }
#if ENABLE_GRAPHITE #if ENABLE_GRAPHITE
GraphiteFaceWrapper* GetGraphiteFace() const; GraphiteFaceWrapper* GetGraphiteFace() const;
...@@ -201,7 +200,6 @@ private: ...@@ -201,7 +200,6 @@ private:
void ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_* ) const; void ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_* ) const;
void ApplyGSUB( const FontSelectPattern& ); void ApplyGSUB( const FontSelectPattern& );
GlyphData& GetGlyphData( sal_GlyphId );
ServerFontLayoutEngine* GetLayoutEngine(); ServerFontLayoutEngine* GetLayoutEngine();
......
...@@ -304,14 +304,14 @@ long FreetypeFont::Release() const ...@@ -304,14 +304,14 @@ long FreetypeFont::Release() const
return --mnRefCount; return --mnRefCount;
} }
GlyphData& FreetypeFont::GetGlyphData( sal_GlyphId aGlyphId ) const GlyphMetric& FreetypeFont::GetGlyphMetric(sal_GlyphId aGlyphId)
{ {
// usually the GlyphData is cached // usually the GlyphData is cached
GlyphList::iterator it = maGlyphList.find( aGlyphId ); GlyphList::iterator it = maGlyphList.find( aGlyphId );
if( it != maGlyphList.end() ) { if( it != maGlyphList.end() ) {
GlyphData& rGlyphData = it->second; GlyphData& rGlyphData = it->second;
GlyphCache::GetInstance().UsingGlyph( *this, rGlyphData ); GlyphCache::GetInstance().UsingGlyph( *this, rGlyphData );
return rGlyphData; return rGlyphData.GetMetric();
} }
// sometimes not => we need to create and initialize it ourselves // sometimes not => we need to create and initialize it ourselves
...@@ -319,7 +319,7 @@ GlyphData& FreetypeFont::GetGlyphData( sal_GlyphId aGlyphId ) ...@@ -319,7 +319,7 @@ GlyphData& FreetypeFont::GetGlyphData( sal_GlyphId aGlyphId )
mnBytesUsed += sizeof( GlyphData ); mnBytesUsed += sizeof( GlyphData );
InitGlyphData( aGlyphId, rGlyphData ); InitGlyphData( aGlyphId, rGlyphData );
GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData ); GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData );
return rGlyphData; return rGlyphData.GetMetric();
} }
void FreetypeFont::GarbageCollect( long nMinLruIndex ) void FreetypeFont::GarbageCollect( long nMinLruIndex )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment