"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/qgsmaprendererjob.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgsmaprendererjob.cpp  (QGIS-final-3_14_15):qgsmaprendererjob.cpp  (QGIS-final-3_14_16)
skipping to change at line 34 skipping to change at line 34
#include "qgsrendercontext.h" #include "qgsrendercontext.h"
#include "qgsmaplayer.h" #include "qgsmaplayer.h"
#include "qgsproject.h" #include "qgsproject.h"
#include "qgsmaplayerrenderer.h" #include "qgsmaplayerrenderer.h"
#include "qgsmaplayerstylemanager.h" #include "qgsmaplayerstylemanager.h"
#include "qgsmaprenderercache.h" #include "qgsmaprenderercache.h"
#include "qgsmessagelog.h" #include "qgsmessagelog.h"
#include "qgspallabeling.h" #include "qgspallabeling.h"
#include "qgsvectorlayerrenderer.h" #include "qgsvectorlayerrenderer.h"
#include "qgsvectorlayer.h" #include "qgsvectorlayer.h"
#include "qgsvectortilelayer.h"
#include "qgsexception.h" #include "qgsexception.h"
#include "qgslabelingengine.h" #include "qgslabelingengine.h"
#include "qgsmaplayerlistutils.h" #include "qgsmaplayerlistutils.h"
#include "qgsvectorlayerlabeling.h" #include "qgsvectorlayerlabeling.h"
#include "qgssettings.h" #include "qgssettings.h"
#include "qgsexpressioncontextutils.h" #include "qgsexpressioncontextutils.h"
#include "qgssymbol.h" #include "qgssymbol.h"
#include "qgsrenderer.h" #include "qgsrenderer.h"
#include "qgssymbollayer.h" #include "qgssymbollayer.h"
#include "qgsvectorlayerutils.h" #include "qgsvectorlayerutils.h"
skipping to change at line 95 skipping to change at line 96
return mSettings; return mSettings;
} }
bool QgsMapRendererJob::prepareLabelCache() const bool QgsMapRendererJob::prepareLabelCache() const
{ {
bool canCache = mCache; bool canCache = mCache;
// calculate which layers will be labeled // calculate which layers will be labeled
QSet< QgsMapLayer * > labeledLayers; QSet< QgsMapLayer * > labeledLayers;
const QList<QgsMapLayer *> layers = mSettings.layers(); const QList<QgsMapLayer *> layers = mSettings.layers();
for ( const QgsMapLayer *ml : layers ) for ( QgsMapLayer *ml : layers )
{ {
QgsVectorLayer *vl = const_cast< QgsVectorLayer * >( qobject_cast<const QgsV if ( QgsPalLabeling::staticWillUseLayer( ml ) )
ectorLayer *>( ml ) ); labeledLayers << ml;
if ( vl && QgsPalLabeling::staticWillUseLayer( vl ) )
labeledLayers << vl; switch ( ml->type() )
if ( vl && vl->labelsEnabled() && vl->labeling()->requiresAdvancedEffects()
)
{ {
canCache = false; case QgsMapLayerType::VectorLayer:
break; {
QgsVectorLayer *vl = qobject_cast< QgsVectorLayer *>( ml );
if ( vl->labelsEnabled() && vl->labeling()->requiresAdvancedEffects() )
{
canCache = false;
}
break;
}
case QgsMapLayerType::VectorTileLayer:
{
// TODO -- add detection of advanced labeling effects for vector tile la
yers
break;
}
case QgsMapLayerType::RasterLayer:
case QgsMapLayerType::PluginLayer:
case QgsMapLayerType::MeshLayer:
break;
} }
if ( !canCache )
break;
} }
if ( mCache && mCache->hasCacheImage( LABEL_CACHE_ID ) ) if ( mCache && mCache->hasCacheImage( LABEL_CACHE_ID ) )
{ {
// we may need to clear label cache and re-register labeled features - check for that here // we may need to clear label cache and re-register labeled features - check for that here
// can we reuse the cached label solution? // can we reuse the cached label solution?
bool canUseCache = canCache && qgis::listToSet( mCache->dependentLayers( LAB EL_CACHE_ID ) ) == labeledLayers; bool canUseCache = canCache && qgis::listToSet( mCache->dependentLayers( LAB EL_CACHE_ID ) ) == labeledLayers;
if ( !canUseCache ) if ( !canUseCache )
{ {
skipping to change at line 327 skipping to change at line 350
if ( !r1.isFinite() || !r2.isFinite() ) if ( !r1.isFinite() || !r2.isFinite() )
{ {
mErrors.append( Error( ml->id(), tr( "There was a problem transforming the layer's extent. Layer skipped." ) ) ); mErrors.append( Error( ml->id(), tr( "There was a problem transforming the layer's extent. Layer skipped." ) ) );
continue; continue;
} }
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( ml ); QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( ml );
// Force render of layers that are being edited // Force render of layers that are being edited
// or if there's a labeling engine that needs the layer to register features // or if there's a labeling engine that needs the layer to register features
if ( mCache && vl ) if ( mCache )
{ {
bool requiresLabeling = false; const bool requiresLabeling = ( labelingEngine2 && QgsPalLabeling::staticW
requiresLabeling = ( labelingEngine2 && QgsPalLabeling::staticWillUseLayer illUseLayer( ml ) ) && requiresLabelRedraw;
( vl ) ) && requiresLabelRedraw; if ( ( vl && vl->isEditable() ) || requiresLabeling )
if ( vl->isEditable() || requiresLabeling )
{ {
mCache->clearCacheImage( ml->id() ); mCache->clearCacheImage( ml->id() );
} }
} }
layerJobs.append( LayerRenderJob() ); layerJobs.append( LayerRenderJob() );
LayerRenderJob &job = layerJobs.last(); LayerRenderJob &job = layerJobs.last();
job.cached = false; job.cached = false;
job.img = nullptr; job.img = nullptr;
job.layer = ml; job.layer = ml;
 End of changes. 7 change blocks. 
14 lines changed or deleted 35 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)