Skip to content

Commit

Permalink
Actually properly hookup responsive cancelation for blurs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 24, 2021
1 parent 81dcc34 commit f4987b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/effects/qgsblureffect.cpp
Expand Up @@ -47,7 +47,7 @@ void QgsBlurEffect::drawStackBlur( QgsRenderContext &context )
{
const int blurLevel = std::round( context.convertToPainterUnits( mBlurLevel, mBlurUnit, mBlurMapUnitScale ) );
QImage im = sourceAsImage( context )->copy();
QgsImageOperation::stackBlur( im, blurLevel, context.feedback() );
QgsImageOperation::stackBlur( im, blurLevel, false, context.feedback() );
drawBlurredImage( context, im );
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/effects/qgsgloweffect.cpp
Expand Up @@ -73,7 +73,7 @@ void QgsGlowEffect::draw( QgsRenderContext &context )
const int blurLevel = std::round( context.convertToPainterUnits( mBlurLevel, mBlurUnit, mBlurMapUnitScale ) );
if ( blurLevel <= 16 )
{
QgsImageOperation::stackBlur( im, blurLevel, context.feedback() );
QgsImageOperation::stackBlur( im, blurLevel, false, context.feedback() );
}
else
{
Expand Down
8 changes: 7 additions & 1 deletion src/core/effects/qgsshadoweffect.cpp
Expand Up @@ -31,8 +31,14 @@ void QgsShadowEffect::draw( QgsRenderContext &context )
if ( !source() || !enabled() || !context.painter() )
return;

if ( context.feedback() && context.feedback()->isCanceled() )
return;

QImage colorisedIm = sourceAsImage( context )->copy();

if ( context.feedback() && context.feedback()->isCanceled() )
return;

QPainter *painter = context.painter();
const QgsScopedQPainterState painterState( painter );
painter->setCompositionMode( mBlendMode );
Expand All @@ -49,7 +55,7 @@ void QgsShadowEffect::draw( QgsRenderContext &context )
const int blurLevel = std::round( context.convertToPainterUnits( mBlurLevel, mBlurUnit, mBlurMapUnitScale ) );
if ( blurLevel <= 16 )
{
QgsImageOperation::stackBlur( colorisedIm, blurLevel, context.feedback() );
QgsImageOperation::stackBlur( colorisedIm, blurLevel, false, context.feedback() );
}
else
{
Expand Down

0 comments on commit f4987b2

Please sign in to comment.