Commit 69f91f70 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Make KisSafeNodeProjectionStore actually reuse the projection

Without any image present, the store will just drop the
projection without any reusing. It may cause small slowdowns
in the beginning of the stroke and (theoretically) memory
fragmentation on Windows.

I'm not sure if it actually the reason of the 408133, so we
need a confirmation from the reporter first.

CCBUG:408133
parent 3dc58200
......@@ -200,6 +200,7 @@ KisLayer::KisLayer(KisImageWSP image, const QString &name, quint8 opacity)
m_d->metaDataStore = new KisMetaData::Store();
m_d->projectionPlane = toQShared(new KisLayerProjectionPlane(this));
m_d->safeProjection = new KisSafeNodeProjectionStore();
m_d->safeProjection->setImage(image);
}
KisLayer::KisLayer(const KisLayer& rhs)
......@@ -213,6 +214,7 @@ KisLayer::KisLayer(const KisLayer& rhs)
setName(rhs.name());
m_d->projectionPlane = toQShared(new KisLayerProjectionPlane(this));
m_d->safeProjection = new KisSafeNodeProjectionStore(*rhs.m_d->safeProjection);
m_d->safeProjection->setImage(image());
if (rhs.m_d->layerStyle) {
m_d->layerStyle = rhs.m_d->layerStyle->clone();
......
......@@ -79,6 +79,7 @@ KisMask::KisMask(const QString & name)
{
setName(name);
m_d->safeProjection = new KisSafeSelectionNodeProjectionStore();
m_d->safeProjection->setImage(image());
}
KisMask::KisMask(const KisMask& rhs)
......
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