Commit bfaec3cf authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix smearing of the heightmap channel

parent 548bad28
......@@ -55,7 +55,6 @@ void KisColorSmudgeStrategyLightness::initializePainting()
m_smearAlpha,
m_initializationPainter->compositeOp()->id());
m_heightmapPainter.begin(m_heightmapDevice);
m_finalPainter.begin(m_colorOnlyDevice);
m_finalPainter.setCompositeOp(COMPOSITE_COPY);
......@@ -63,9 +62,6 @@ void KisColorSmudgeStrategyLightness::initializePainting()
m_finalPainter.setChannelFlags(m_initializationPainter->channelFlags());
m_finalPainter.copyMirrorInformationFrom(m_initializationPainter);
m_heightmapPainter.setCompositeOp(COMPOSITE_OVER);
m_heightmapPainter.setSelection(m_initializationPainter->selection());
m_heightmapPainter.copyMirrorInformationFrom(m_initializationPainter);
// we should read data from the color layer, not from the final projection layer
m_sourceWrapperDevice = toQShared(new KisColorSmudgeSourcePaintDevice(*m_layerOverlayDevice, 1));
......@@ -73,6 +69,11 @@ void KisColorSmudgeStrategyLightness::initializePainting()
m_heightmapOverlayDevice.reset(new KisOverlayPaintDeviceWrapper(m_heightmapDevice, 1, KisOverlayPaintDeviceWrapper::LazyPreciseMode));
m_heightmapWrapperDevice.reset(new KisColorSmudgeSourcePaintDevice(*m_heightmapOverlayDevice));
m_origDab->setColorSpace(m_heightmapOverlayDevice->overlayColorSpace());
m_heightmapPainter.begin(m_heightmapOverlayDevice->overlay());
m_heightmapPainter.setCompositeOp(COMPOSITE_OVER);
m_heightmapPainter.setSelection(m_initializationPainter->selection());
m_heightmapPainter.copyMirrorInformationFrom(m_initializationPainter);
}
KisColorSmudgeStrategyBase::DabColoringStrategy &KisColorSmudgeStrategyLightness::coloringStrategy()
......@@ -116,6 +117,7 @@ KisColorSmudgeStrategyLightness::paintDab(const QRect &srcRect, const QRect &dst
readRects << mirroredRects;
readRects << srcRect;
m_sourceWrapperDevice->readRects(readRects);
m_heightmapWrapperDevice->readRects(readRects);
blendBrush({&m_finalPainter},
m_sourceWrapperDevice,
......@@ -140,6 +142,10 @@ KisColorSmudgeStrategyLightness::paintDab(const QRect &srcRect, const QRect &dst
maxPossibleSmudgeRateValue,
lightnessStrengthValue,
smudgeRadiusValue);
m_heightmapOverlayDevice->writeRects(mirroredRects);
#if 0
const quint8 thresholdHeightmapOpacity = qRound(0.2 * 255.0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment