[Libreoffice-commits] core.git: sd/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 16 08:12:02 UTC 2020


 sd/source/ui/view/drviews1.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit a559ddd37b09a35f26a291f1a0f94608309a7d99
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Oct 9 18:09:56 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Fri Oct 16 10:11:14 2020 +0200

    try to prefetch in threads also all graphics for the active page
    
    Change-Id: Ib4df3914a4f510a76f08aa2f6633bfdadf54a1e4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104131
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 70c9ba3a2090..09814bd7b470 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -39,6 +39,7 @@
 #include <svx/fmshell.hxx>
 #include <tools/debug.hxx>
 #include <tools/diagnose_ex.h>
+#include <vcl/graphicfilter.hxx>
 
 #include <view/viewoverlaymanager.hxx>
 
@@ -997,6 +998,13 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
             VisAreaChanged(::tools::Rectangle(Point(), Size(1, 1)));
         }
 
+        // Try to prefetch all graphics for the active page. This will be done
+        // in threads to be more efficient than loading them on-demand one by one.
+        std::vector<Graphic*> graphics;
+        mpActualPage->getGraphicsForPrefetch(graphics);
+        if(graphics.size() > 1) // threading does not help with loading just one
+            GraphicFilter::GetGraphicFilter().MakeGraphicsAvailableThreaded(graphics);
+
         if (meEditMode == EditMode::Page)
         {
             /**********************************************************************


More information about the Libreoffice-commits mailing list