mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
Only draw source once if forcing vector and any part of stack requires raster
Avoids multiple stacked sources when forcing vector outputs
This commit is contained in:
parent
fa40eedcd3
commit
afc2d008fa
@ -94,6 +94,27 @@ void QgsEffectStack::draw( QgsRenderContext &context )
|
||||
{
|
||||
QPainter *destPainter = context.painter();
|
||||
|
||||
if ( context.rasterizedRenderingPolicy() == Qgis::RasterizedRenderingPolicy::ForceVector )
|
||||
{
|
||||
// can we render this stack if we're forcing vectors?
|
||||
bool requiresRasterization = false;
|
||||
for ( const QgsPaintEffect *effect : std::as_const( mEffectList ) )
|
||||
{
|
||||
if ( effect->enabled() && effect->flags().testFlag( Qgis::PaintEffectFlag::RequiresRasterization ) )
|
||||
{
|
||||
requiresRasterization = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( requiresRasterization )
|
||||
{
|
||||
//just draw unmodified source, we can't render this effect stack when forcing vectors
|
||||
drawSource( *context.painter() );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//first, we build up a list of rendered effects
|
||||
//we do this moving backwards through the stack, so that each effect's results
|
||||
//becomes the source of the previous effect
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgis.h"
|
||||
#include <QPainter>
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
|
Loading…
x
Reference in New Issue
Block a user