diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-12-16 11:07:02 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-12-17 20:36:43 +0100 |
commit | a66a6f4cc8efbca282d39e8dd48709ec82bbc26b (patch) | |
tree | c270f3e5db7cf4917b70b50bca45b0dc3d6b4572 /sd | |
parent | 0c37e164dbbff89ecac843e1b182fdbce70cda34 (diff) |
prefetch graphics also for page before and after in slidesorter
The idea is that this will make them preloaded for when the user
scrolls e.g. using PageDown.
Change-Id: Icac9b6e88b25e9b0434c5ab7a152f47866dfadc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107823
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/view/SlideSorterView.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index a531943096f1..f13aa1b7eb09 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -654,6 +654,14 @@ void SlideSorterView::Paint ( continue; pDescriptor->GetPage()->getGraphicsForPrefetch(graphics); } + // Handle also one page before and after to have those in advance on scrolling. + for (::tools::Long nIndex : { aRange.Min() - 1, aRange.Max() + 1 }) + { + model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex)); + if (!pDescriptor) + continue; + pDescriptor->GetPage()->getGraphicsForPrefetch(graphics); + } if(graphics.size() > 1) // threading does not help with loading just one GraphicFilter::GetGraphicFilter().MakeGraphicsAvailableThreaded(graphics); |