16 #ifndef QGSMAPRENDERERJOB_H
17 #define QGSMAPRENDERERJOB_H
19 #include "qgis_core.h"
21 #include <QFutureWatcher>
57 bool imageInitialized =
false;
59 QPainter::CompositionMode blendMode;
92 QImage *maskImage =
nullptr;
99 LayerRenderJob *firstPassJob =
nullptr;
107 QList<QPair<LayerRenderJob *, int>> maskJobs;
110 typedef QList<LayerRenderJob> LayerRenderJobs;
116 struct LabelRenderJob
124 QImage *img =
nullptr;
136 QVector<QImage *> maskImages;
147 bool canUseCache =
false;
149 bool complete =
false;
151 int renderingTime = -1;
153 QList< QPointer< QgsMapLayer > > participatingLayers;
197 virtual void start() = 0;
203 virtual void cancel() = 0;
210 virtual void cancelWithoutBlocking() = 0;
213 virtual void waitForFinished() = 0;
216 virtual bool isActive()
const = 0;
225 virtual bool usedCachedLabels()
const = 0;
252 Error(
const QString &lid,
const QString &msg )
261 typedef QList<QgsMapRendererJob::Error>
Errors;
284 QHash< QgsMapLayer *, int > perLayerRenderingTime() const
SIP_SKIP;
308 void renderingLayersFinished();
316 QElapsedTimer mRenderingStart;
321 int mRenderingTime = 0;
329 bool mRecordRenderingTime = true;
336 bool prepareLabelCache() const
SIP_SKIP;
349 LayerRenderJobs prepareJobs( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool deferredPainterSet = false )
SIP_SKIP;
356 LabelRenderJob prepareLabelingJob( QPainter *painter,
QgsLabelingEngine *labelingEngine2,
bool canUseLabelCache = true )
SIP_SKIP;
366 LayerRenderJobs prepareSecondPassJobs( LayerRenderJobs &firstPassJobs, LabelRenderJob &labelJob )
SIP_SKIP;
369 static QImage composeImage( const
QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob )
SIP_SKIP;
377 static
void composeSecondPass( LayerRenderJobs &secondPassJobs, LabelRenderJob &labelJob )
SIP_SKIP;
380 void logRenderingTime( const LayerRenderJobs &jobs, const LayerRenderJobs &secondPassJobs, const LabelRenderJob &labelJob )
SIP_SKIP;
383 void cleanupJobs( LayerRenderJobs &jobs )
SIP_SKIP;
386 void cleanupSecondPassJobs( LayerRenderJobs &jobs )
SIP_SKIP;
394 void cleanupLabelJob( LabelRenderJob &job )
SIP_SKIP;
421 QImage *allocateImage( QString layerId );
424 QPainter *allocateImageAndPainter( QString layerId, QImage *&image );
443 virtual QImage renderedImage() = 0;
448 #endif // QGSMAPRENDERERJOB_H