diff --git a/core/page.cpp b/core/page.cpp index 33c6127c4..4b7539abf 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -116,10 +116,12 @@ void PagePrivate::imageRotationDone( RotationJob * job ) PixmapObject &object = it.value(); (*object.m_pixmap) = QPixmap::fromImage( job->image() ); object.m_rotation = job->rotation(); + object.m_isPartialPixmap = job->isPartialUpdate(); } else { PixmapObject object; object.m_pixmap = new QPixmap( QPixmap::fromImage( job->image() ) ); object.m_rotation = job->rotation(); + object.m_isPartialPixmap = job->isPartialUpdate(); m_pixmaps.insert( job->observer(), object ); } @@ -235,6 +237,9 @@ bool Page::hasPixmap( DocumentObserver *observer, int width, int height, const N if ( width == -1 || height == -1 ) return true; + if ( it.value().m_isPartialPixmap ) + return false; + const QPixmap *pixmap = it.value().m_pixmap; return (pixmap->width() == width && pixmap->height() == height); @@ -556,6 +561,7 @@ void PagePrivate::setPixmap( DocumentObserver *observer, QPixmap *pixmap, const } it.value().m_pixmap = pixmap; it.value().m_rotation = m_rotation; + it.value().m_isPartialPixmap = isPartialPixmap; } else { // it can happen that we get a setPixmap while closing and thus the page controller is gone if ( m_doc->m_pageController ) diff --git a/core/page.h b/core/page.h index b33f0e039..19d6410f7 100644 --- a/core/page.h +++ b/core/page.h @@ -141,8 +141,9 @@ class OKULARCORE_EXPORT Page void setBoundingBox( const NormalizedRect& bbox ); /** - * Returns whether the page of size @p width x @p height has a @p pixmap + * Returns whether the page of size @p width x @p height has a @p pixmap * in the region given by @p rect for the given @p observer + * If there is a partially rendered pixmap the answer is false. */ bool hasPixmap( DocumentObserver *observer, int width = -1, int height = -1, const NormalizedRect &rect = NormalizedRect() ) const; diff --git a/core/page_p.h b/core/page_p.h index 46cf0a946..eda83d6f6 100644 --- a/core/page_p.h +++ b/core/page_p.h @@ -146,6 +146,7 @@ class PagePrivate public: QPixmap *m_pixmap = nullptr; Rotation m_rotation; + bool m_isPartialPixmap = false; }; QMap< DocumentObserver*, PixmapObject > m_pixmaps; QMap< const DocumentObserver*, TilesManager *> m_tilesManagers;