From kde-kimageshop Tue Aug 18 23:04:39 2020 From: L. E. Segovia Date: Tue, 18 Aug 2020 23:04:39 +0000 To: kde-kimageshop Subject: [graphics/krita/krita/4.3] libs/image/generator: Fill Layers: re-render the whole layer if the image Message-Id: <20200818230439.40DFC124023D () leptone ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=159779189825890 Git commit 3f3062e757177112645967a9955f5bcbb3eaba59 by L. E. Segovia. Committed on 18/08/2020 at 22:54. Pushed by lsegovia into branch 'krita/4.3'. Fill Layers: re-render the whole layer if the image bounds change Before this commit, if a Fill Layer was to be re-rendered as a consequence of an image resize, it would improperly attempt to preserve the existing rendered quadrant. To fix this, the image bounds are saved after an update job is called. If they change in the next update, the preparedRect is cleared and the layer is completely re-rendered again. CC: kimageshop@kde.org M +6 -0 libs/image/generator/kis_generator_layer.cpp https://invent.kde.org/graphics/krita/commit/3f3062e757177112645967a9955f5b= cbb3eaba59 diff --git a/libs/image/generator/kis_generator_layer.cpp b/libs/image/gene= rator/kis_generator_layer.cpp index a79a0006a4..f2be79e69e 100644 --- a/libs/image/generator/kis_generator_layer.cpp +++ b/libs/image/generator/kis_generator_layer.cpp @@ -50,6 +50,7 @@ struct Q_DECL_HIDDEN KisGeneratorLayer::Private = KisThreadSafeSignalCompressor updateSignalCompressor; QRect preparedRect; + QRect preparedImageBounds; KisFilterConfigurationSP preparedForFilter; QWeakPointer updateCookie; QMutex mutex; @@ -125,6 +126,10 @@ void KisGeneratorLayer::requestUpdateJobsWithStroke(Ki= sStrokeId strokeId, KisFil locker.relock(); } = + if (m_d->preparedImageBounds !=3D image->bounds()) { + m_d->preparedRect =3D QRect(); + } + const QRegion processRegion(QRegion(updateRect) - m_d->preparedRect); if (processRegion.isEmpty()) return; @@ -146,6 +151,7 @@ void KisGeneratorLayer::requestUpdateJobsWithStroke(Kis= StrokeId strokeId, KisFil = m_d->updateCookie =3D cookie; m_d->preparedRect =3D updateRect; + m_d->preparedImageBounds =3D image->bounds(); m_d->preparedForFilter =3D filterConfig; } =20