From b4d1c8e884673158277cd20f9fc83b71de69d4c9 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 26 Feb 2020 06:59:09 +0000 Subject: lru_scale_cache - cache the same bitmap at multiple scales. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Helps accelerate different views at different scales, as well as document / image thumbnailing on save, as well as stray views that can get rendered behind the scenes at odd scales on mobile. Each scale + bitmap combination is another key in the LRU table. Change-Id: Id82ce2e4180608082c9ca16fad35bba9e8c2e81a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89497 Reviewed-by: Tomaž Vajngerl Reviewed-by: Miklos Vajna Tested-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89503 Tested-by: Jenkins --- vcl/source/app/salvtables.cxx | 7 +++---- vcl/source/app/svmain.cxx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 0dc8b989f408..943f6f1e0be4 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -137,10 +137,9 @@ void SalBitmap::DropScaledCache() if (ImplSVData* pSVData = ImplGetSVData()) { auto& rCache = pSVData->maGDIData.maScaleCache; - rCache.remove_if( - [this](const o3tl::lru_map::key_value_pair_t& rKeyValuePair) { - return rKeyValuePair.first == this; - }); + + rCache.remove_if([this] (const lru_scale_cache::key_value_pair_t& rKeyValuePair) + { return rKeyValuePair.first.mpBitmap == this; }); } } diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index ca1818fc20ff..baa881d84e06 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -584,7 +584,7 @@ void DeInitVCL() pSVData->maGDIData.mxScreenFontList.reset(); pSVData->maGDIData.mxScreenFontCache.reset(); - pSVData->maGDIData.maScaleCache.remove_if([](const o3tl::lru_map::key_value_pair_t&) + pSVData->maGDIData.maScaleCache.remove_if([](const lru_scale_cache::key_value_pair_t&) { return true; }); pSVData->maGDIData.maThemeDrawCommandsCache.clear(); -- cgit