mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-29 12:44:01 +00:00
pageview: Send pixmap preload requests in order of increasing distance from the viewport
(instead of requesting everything past it till the end of the document, and then starting to load backwards)
This commit is contained in:
parent
b78aa89d12
commit
a022d124e6
|
@ -4019,10 +4019,7 @@ void PageView::slotRequestVisiblePixmaps( int newValue )
|
|||
requestedPixmaps.push_back( new Okular::PixmapRequest(
|
||||
PAGEVIEW_ID, i->pageNumber(), i->uncroppedWidth(), i->uncroppedHeight(), PAGEVIEW_PRELOAD_PRIO, true ) );
|
||||
}
|
||||
}
|
||||
|
||||
for( int j = 1; j <= pagesToPreload; j++ )
|
||||
{
|
||||
// add the page before the 'visible series' in preload
|
||||
int headRequest = d->visibleItems.first()->pageNumber() - j;
|
||||
if ( headRequest >= 0 )
|
||||
|
@ -4033,6 +4030,10 @@ void PageView::slotRequestVisiblePixmaps( int newValue )
|
|||
requestedPixmaps.push_back( new Okular::PixmapRequest(
|
||||
PAGEVIEW_ID, i->pageNumber(), i->uncroppedWidth(), i->uncroppedHeight(), PAGEVIEW_PRELOAD_PRIO, true ) );
|
||||
}
|
||||
|
||||
// stop if we've already reached both ends of the document
|
||||
if ( headRequest < 0 && tailRequest >= (int)d->items.count() )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue