Summary: | presentation mode is slow | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Pascal d'Hermilly <pascal> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Pascal d'Hermilly
2006-08-07 23:18:30 UTC
Can anyone confirm this? > 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
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 { |