summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-02-26 06:59:09 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-26 20:51:16 +0100
commitb4d1c8e884673158277cd20f9fc83b71de69d4c9 (patch)
treea27ba2309c6861651e16ea0af3849ecdbea8e828 /vcl/source/app
parent2376cc7ce9bd4319f0f011ab13445ceb6817c7f1 (diff)
lru_scale_cache - cache the same bitmap at multiple scales.
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 <quikee@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89503 Tested-by: Jenkins
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx7
-rw-r--r--vcl/source/app/svmain.cxx2
2 files changed, 4 insertions, 5 deletions
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<SalBitmap*, BitmapEx>::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<SalBitmap*, BitmapEx>::key_value_pair_t&)
+ pSVData->maGDIData.maScaleCache.remove_if([](const lru_scale_cache::key_value_pair_t&)
{ return true; });
pSVData->maGDIData.maThemeDrawCommandsCache.clear();