summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-05-27 16:37:30 +0200
committerAndras Timar <andras.timar@collabora.com>2014-05-31 10:53:56 +0000
commit27c29269d569cc7ec175da17f012a04123a9ac7c (patch)
tree82ccb32ab9041e36b3175c97351d1b53e7a0c3b1 /vcl
parentd1747c012932151e8a46c4b89a0d530dd5018fa4 (diff)
Related bnc#822625: Cache FontEntry with the original FontSelectPattern.
Otherwise we do not hit cache directly, only after expensive call to ImplFindByFont. (cherry picked from commits a6b00d16eb27a5e7e31c721671001a909ecef960 and 16a62079018aea0e72636bdb00576487b4e830b9) Change-Id: If15b368feeba94c8fff8ee7cbe049fc4a2069768 Reviewed-on: https://gerrit.libreoffice.org/9520 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 537f8aad2ed2..a36fc855f31d 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2214,6 +2214,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
FontSelectPattern& aFontSelData, ImplDirectFontSubstitution* pDevSpecific )
{
+ FontSelectPattern aFontSelDataOrig(aFontSelData);
// check if a directly matching logical font instance is already cached,
// the most recently used font usually has a hit rate of >50%
ImplFontEntry *pEntry = NULL;
@@ -2300,8 +2301,9 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
}
#endif
- // add the new entry to the cache
- maFontInstanceList[ aFontSelData ] = pEntry;
+ // Add the new entry to the cache with the original FontSelectPattern,
+ // so that we can find it next time as a direct cache hit.
+ maFontInstanceList[ aFontSelDataOrig ] = pEntry;
}
mpFirstEntry = pEntry;