summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-19 21:03:53 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-22 02:05:10 +0100
commit835cae7e323b9831d11f5f4957933728f561e71a (patch)
tree334f20aafcfdca67266f359079edf064e6fcd7fa
parentf5938e1c3de3a7e55719eb47e2e87666189ed222 (diff)
fdo#38090: vcl: remove ImplFontCache::maFontNameList:
The font cache in VCL returns different fonts for identical parameters, which causes layout differences in Writer. first we search the font with language 1054: debug: XXX 0x2103950 add to maFontNameList: TH SarabunPSK->waree p maFontNameList $9 = boost::unordered_map with 1 elements = { ["TH SarabunPSK"] = "waree" debug: XXX 0x2103950 found in maFontNameList: TH SarabunPSK->waree in this very same invocation the "waree" is then rerouted to Deja Vu (which can only be because it was called with language 1033): debug: XXX 0x2103950 add to maFontNameList: TH SarabunPSK->dejavusans p maFontNameList $11 = boost::unordered_map with 1 elements = { ["TH SarabunPSK"] = "dejavusans" } debug: XXX 0x2103950 found in maFontNameList: TH SarabunPSK->dejavusans - the selection of different fonts happens in FcPreMatchSubstititution::FindFontSubstitute. - we never get a direct cache hit from maFontInstanceList because there are some differences like WIDTH_DONTKNOW, and the maSearchName - the first time a font is searched, it ends up in maFontInstanceList - the second time a font is searched, it may end up in maFontNameList, which maps _only_ based on the name (appears to be an invalid optimization) - once we have TH SarabunPSK->dejavusans in maFontNameList we can never select the other one because apparently dejavusans covers all languages Change-Id: Ibd73de88d8fc3b6e1319eb34c261e55ea217a988 (cherry picked from commit bb51791ae49ecded0f618b4534893adb8fcf917e)
-rw-r--r--vcl/inc/outdev.h4
-rw-r--r--vcl/source/gdi/outdev3.cxx26
2 files changed, 0 insertions, 30 deletions
diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
index a37f2a958074..20c1d36f4f14 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -210,10 +210,6 @@ private:
typedef ::boost::unordered_map<FontSelectPattern,ImplFontEntry*,IFSD_Hash,IFSD_Equal > FontInstanceList;
FontInstanceList maFontInstanceList;
- // cache of recently requested font names vs. selected font names
- typedef ::boost::unordered_map<String,String,FontNameHash> FontNameList;
- FontNameList maFontNameList;
-
public:
ImplFontCache( bool bPrinter );
~ImplFontCache();
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index acd50e21d762..fdb79f45706c 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2343,22 +2343,6 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
{
String aSearchName = rFont.GetName();
- // TODO: also add device specific name caching
- if( !pDevSpecific )
- {
- // check if the requested font name is already known
- // if it is already known get its normalized search name
- FontNameList::const_iterator it_name = maFontNameList.find( aSearchName );
- if( it_name != maFontNameList.end() )
- if( !(*it_name).second.EqualsAscii( "hg", 0, 2)
-#ifdef ENABLE_GRAPHITE
- && (aSearchName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
- == STRING_NOTFOUND)
-#endif
- )
- aSearchName = (*it_name).second;
- }
-
// initialize internal font request object
FontSelectPattern aFontSelData( rFont, aSearchName, rSize, fExactHeight );
return GetFontEntry( pFontList, aFontSelData, pDevSpecific );
@@ -2397,16 +2381,6 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
{
// we have an indirect cache hit
pEntry = (*it).second;
- // cache the requested and the selected font names
- // => next time there is a good chance for a direct cache hit
- // don't allow the cache to grow too big
- // TODO: implement some fancy LRU caching?
- if( maFontNameList.size() >= 4000 )
- maFontNameList.clear();
- // TODO: also add device specific name caching
- if( !pDevSpecific )
- if( aFontSelData.maName != aFontSelData.maSearchName )
- maFontNameList[ aFontSelData.maName ] = aFontSelData.maSearchName;
}
}