mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
Merge remote-tracking branch 'origin/Applications/16.12'
This commit is contained in:
commit
f06bf612d7
|
@ -494,6 +494,10 @@ QImage KDjVu::Private::generateImageTile( ddjvu_page_t *djvupage, int& res,
|
|||
ddjvu_page_get_width( djvupage );
|
||||
res = ddjvu_page_render( djvupage, DDJVU_RENDER_COLOR,
|
||||
&pagerect, &renderrect, m_format, res_img.bytesPerLine(), (char *)res_img.bits() );
|
||||
if (!res)
|
||||
{
|
||||
res_img.fill(Qt::white);
|
||||
}
|
||||
#ifdef KDJVU_DEBUG
|
||||
qDebug() << "rendering result:" << res;
|
||||
#endif
|
||||
|
@ -909,27 +913,27 @@ QImage KDjVu::image( int page, int width, int height, int rotation )
|
|||
{
|
||||
if ( d->m_cacheEnabled )
|
||||
{
|
||||
bool found = false;
|
||||
QList<ImageCacheItem*>::Iterator it = d->mImgCache.begin(), itEnd = d->mImgCache.end();
|
||||
for ( ; ( it != itEnd ) && !found; ++it )
|
||||
{
|
||||
ImageCacheItem* cur = *it;
|
||||
if ( ( cur->page == page ) &&
|
||||
( rotation % 2 == 0
|
||||
? cur->width == width && cur->height == height
|
||||
: cur->width == height && cur->height == width ) )
|
||||
found = true;
|
||||
}
|
||||
if ( found )
|
||||
{
|
||||
// taking the element and pushing to the top of the list
|
||||
--it;
|
||||
ImageCacheItem* cur2 = *it;
|
||||
d->mImgCache.erase( it );
|
||||
d->mImgCache.push_front( cur2 );
|
||||
bool found = false;
|
||||
QList<ImageCacheItem*>::Iterator it = d->mImgCache.begin(), itEnd = d->mImgCache.end();
|
||||
for ( ; ( it != itEnd ) && !found; ++it )
|
||||
{
|
||||
ImageCacheItem* cur = *it;
|
||||
if ( ( cur->page == page ) &&
|
||||
( rotation % 2 == 0
|
||||
? cur->width == width && cur->height == height
|
||||
: cur->width == height && cur->height == width ) )
|
||||
found = true;
|
||||
}
|
||||
if ( found )
|
||||
{
|
||||
// taking the element and pushing to the top of the list
|
||||
--it;
|
||||
ImageCacheItem* cur2 = *it;
|
||||
d->mImgCache.erase( it );
|
||||
d->mImgCache.push_front( cur2 );
|
||||
|
||||
return cur2->img;
|
||||
}
|
||||
return cur2->img;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !d->m_pages_cache.at( page ) )
|
||||
|
|
Loading…
Reference in a new issue