29 bool parallelRendering
34 mParallelRendering( parallelRendering )
35 , mFeatureFilterProvider( featureFilterProvider )
37 #ifndef HAVE_SERVER_PYTHON_PLUGINS
38 Q_UNUSED( mFeatureFilterProvider )
40 if ( mParallelRendering )
43 QgsMessageLog::logMessage( QStringLiteral(
"Parallel rendering activated with %1 threads" ).arg( maxThreads ), QStringLiteral(
"server" ), Qgis::MessageLevel::Info );
47 QgsMessageLog::logMessage( QStringLiteral(
"Parallel rendering deactivated" ), QStringLiteral(
"server" ), Qgis::MessageLevel::Info );
51 void QgsMapRendererJobProxy::render(
const QgsMapSettings &mapSettings, QImage *image )
53 if ( mParallelRendering )
56 #ifdef HAVE_SERVER_PYTHON_PLUGINS
57 renderJob.setFeatureFilterProvider( mFeatureFilterProvider );
65 if ( renderJob.isActive() )
69 renderJob.waitForFinished();
70 *image = renderJob.renderedImage();
71 mPainter.reset(
new QPainter( image ) );
74 mErrors = renderJob.errors();
78 mPainter.reset(
new QPainter( image ) );
80 #ifdef HAVE_SERVER_PYTHON_PLUGINS
81 renderJob.setFeatureFilterProvider( mFeatureFilterProvider );
83 renderJob.renderSynchronously();
84 mErrors = renderJob.errors();
88 QPainter *QgsMapRendererJobProxy::takePainter()
90 return mPainter.release();