Bug 132029 - presentation mode is slow
Summary: presentation mode is slow
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-07 23:18 UTC by Pascal d'Hermilly
Modified: 2006-11-29 22:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal d'Hermilly 2006-08-07 23:18:30 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages

I recently discovered this while reading TUX magazine.. 
Presentation mode is much slower than ordinary viewing of the pdf.

I suspect KDPF of not preloading the pages like it does when I view them ordinarily.

It would be nice if this would be fixed. It is a drag to wait 2 seconds for the slide to load every time I click next.

Cheers

Pascal
Comment 1 Pascal d'Hermilly 2006-11-20 21:25:48 UTC
Can anyone confirm this?
Comment 2 Gilles Schintgen 2006-11-20 23:18:45 UTC
> Can anyone confirm this?

Yes, me.

There's a noticeable delay when switching to the next page. Kpdf should at 
least preload the next page. Especially when "Memory Usage" is set 
to "Aggressive".

Gilles
Comment 3 Albert Astals Cid 2006-11-29 22:49:28 UTC
SVN commit 609253 by aacid:

Preload next and previous page if threading is enabled and not on low memory setting
BUGS: 132029


 M  +3 -2      core/observer.h  
 M  +21 -0     ui/presentationwidget.cpp  


--- branches/KDE/3.5/kdegraphics/kpdf/core/observer.h #609252:609253
@@ -24,10 +24,11 @@
 
 /** PRIORITIES for requests. Globally defined here. **/
 #define PAGEVIEW_PRIO 1
-#define PAGEVIEW_PRELOAD_PRIO 3
+#define PAGEVIEW_PRELOAD_PRIO 4
 #define THUMBNAILS_PRIO 2
-#define THUMBNAILS_PRELOAD_PRIO 4
+#define THUMBNAILS_PRELOAD_PRIO 5
 #define PRESENTATION_PRIO 0
+#define PRESENTATION_PRELOAD_PRIO 3
 
 class KPDFPage;
 
--- branches/KDE/3.5/kdegraphics/kpdf/ui/presentationwidget.cpp #609252:609253
@@ -448,6 +448,27 @@
         m_document->requestPixmaps( request );
         // restore cursor
         QApplication::restoreOverrideCursor();
+        // ask for next and previous page if not in low memory usage setting
+        if (KpdfSettings::memoryLevel() != KpdfSettings::EnumMemoryLevel::Low && KpdfSettings::enableThreading()) {
+            QValueList< PixmapRequest * > asyncRequests;
+            if (newPage + 1 < (int)m_document->pages())
+            {
+                PresentationFrame *nextFrame = m_frames[ newPage + 1 ];
+                pixW = nextFrame->geometry.width();
+                pixH = nextFrame->geometry.height();
+                if ( !nextFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
+                    asyncRequests.push_back( new PixmapRequest( PRESENTATION_ID, newPage + 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) );
+            }
+            if (newPage - 1 >= 0)
+            {
+                PresentationFrame *prevFrame = m_frames[ newPage - 1 ];
+                pixW = prevFrame->geometry.width();
+                pixH = prevFrame->geometry.height();
+                if ( !prevFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
+                    asyncRequests.push_back( new PixmapRequest( PRESENTATION_ID, newPage - 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) );
+            }
+            if (!asyncRequests.isEmpty()) m_document->requestPixmaps( asyncRequests );
+        }
     }
     else
     {