mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-12 20:51:17 +00:00
QtQuick: simplify drawing code
Removes a deprecated optimization
This commit is contained in:
parent
26c40ab7bd
commit
970e0f2ba9
|
@ -42,7 +42,6 @@ PageItem::PageItem(QQuickItem *parent)
|
|||
Okular::View( QLatin1String( "PageView" ) ),
|
||||
m_page(nullptr),
|
||||
m_smooth(false),
|
||||
m_intentionalDraw(false),
|
||||
m_bookmarked(false),
|
||||
m_isThumbnail(false)
|
||||
{
|
||||
|
@ -53,7 +52,7 @@ PageItem::PageItem(QQuickItem *parent)
|
|||
m_redrawTimer = new QTimer(this);
|
||||
m_redrawTimer->setInterval(REDRAW_TIMEOUT);
|
||||
m_redrawTimer->setSingleShot(true);
|
||||
connect(m_redrawTimer, &QTimer::timeout, this, &PageItem::delayedRedraw);
|
||||
connect(m_redrawTimer, &QTimer::timeout, this, &PageItem::paint);
|
||||
}
|
||||
|
||||
|
||||
|
@ -337,11 +336,10 @@ void PageItem::paint()
|
|||
|
||||
qreal dpr = window()->devicePixelRatio();
|
||||
|
||||
if (m_intentionalDraw) {
|
||||
{
|
||||
auto request = new Okular::PixmapRequest(observer, m_viewPort.pageNumber, width() * dpr, height() * dpr, priority, Okular::PixmapRequest::NoFeature);
|
||||
const Okular::Document::PixmapRequestFlag prf = m_isThumbnail ? Okular::Document::NoOption : Okular::Document::RemoveAllPrevious;
|
||||
m_documentItem.data()->document()->requestPixmaps({request}, prf);
|
||||
m_intentionalDraw = false;
|
||||
}
|
||||
const int flags = PagePainter::Accessibility | PagePainter::Highlights | PagePainter::Annotations;
|
||||
// Simply using the limits as described by textureSize will, at times, result in the page painter
|
||||
|
@ -370,14 +368,6 @@ void PageItem::paint()
|
|||
}
|
||||
|
||||
//Protected slots
|
||||
void PageItem::delayedRedraw()
|
||||
{
|
||||
if (m_documentItem && m_page) {
|
||||
m_intentionalDraw = true;
|
||||
paint();
|
||||
}
|
||||
}
|
||||
|
||||
void PageItem::pageHasChanged(int page, int flags)
|
||||
{
|
||||
if (m_viewPort.pageNumber == page) {
|
||||
|
|
|
@ -156,7 +156,6 @@ protected:
|
|||
void setIsThumbnail(bool thumbnail);
|
||||
|
||||
private Q_SLOTS:
|
||||
void delayedRedraw();
|
||||
void pageHasChanged(int page, int flags);
|
||||
void checkBookmarksChanged();
|
||||
void contentXChanged();
|
||||
|
@ -167,7 +166,6 @@ private:
|
|||
|
||||
const Okular::Page *m_page;
|
||||
bool m_smooth;
|
||||
bool m_intentionalDraw;
|
||||
bool m_bookmarked;
|
||||
bool m_isThumbnail;
|
||||
QPointer<DocumentItem> m_documentItem;
|
||||
|
|
Loading…
Reference in a new issue