~mrqtros/ubuntu-docviewer-app/ubuntu-docviewer-app-pdf-renderengine

« back to all changes in this revision

Viewing changes to src/plugin/libreofficetoolkit-qml-plugin/rendertask.cpp

Code cleanup - phase 2.

Approved by Jenkins Bot, Stefano Verzegnassi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "rendertask.h"
 
2
 
 
3
bool LoRenderTask::canBeRunInParallel(AbstractRenderTask* prevTask)
 
4
{
 
5
    Q_ASSERT(prevTask != nullptr);
 
6
    if (prevTask->type() == RttTile || prevTask->type() == RttImpressThumbnail) {
 
7
        LoRenderTask* loTask = static_cast<LoRenderTask*>(prevTask);
 
8
 
 
9
        // Another document or the same part in the same document can be run parallel.
 
10
        return (loTask->document() != m_document ||
 
11
                loTask->part() == m_part);
 
12
    }
 
13
 
 
14
    return true;
 
15
}
 
16
 
 
17
QImage TileRenderTask::doWork()
 
18
{
 
19
    return m_document->paintTile(m_area.size(), m_area, m_zoom);
 
20
}
 
21
 
 
22
QImage ThumbnailRenderTask::doWork()
 
23
{
 
24
    return m_document->paintThumbnail(m_size);
 
25
}