Commit 597d28b1 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix updates in the new transform tool

Batch markers must not be compressed. I thought that returning a fake
LoD would ensure it, but it is not the case. If we have multiple "start"
(or "end") markers, they should not be compressed as well. For this
purpose, I introduced KisUpdateInfo::canBeCompressed(), which returns
false for all the marker info objects.
parent 8bd149b4
......@@ -25,10 +25,12 @@ bool KisCanvasUpdatesCompressor::putUpdateInfo(KisUpdateInfoSP info)
if (newUpdateRect.isEmpty()) return false;
QMutexLocker l(&m_mutex);
KisUpdateInfoList::iterator it = m_updatesList.begin();
if (info->canBeCompressed()) {
KisUpdateInfoList::iterator it = m_updatesList.begin();
while (it != m_updatesList.end()) {
if (levelOfDetail == (*it)->levelOfDetail() &&
if ((*it)->canBeCompressed() &&
levelOfDetail == (*it)->levelOfDetail() &&
newUpdateRect.contains((*it)->dirtyImageRect())) {
/**
......@@ -41,6 +43,7 @@ bool KisCanvasUpdatesCompressor::putUpdateInfo(KisUpdateInfoSP info)
++it;
}
}
}
m_updatesList.append(info);
......
......@@ -42,6 +42,11 @@ QRect KisUpdateInfo::dirtyViewportRect()
return QRect();
}
bool KisUpdateInfo::canBeCompressed() const
{
return true;
}
QRect KisPPUpdateInfo::dirtyViewportRect() {
return viewportRect.toAlignedRect();
}
......@@ -119,3 +124,8 @@ int KisMarkerUpdateInfo::levelOfDetail() const
// with other updates
return -1 - (int)m_type;
}
bool KisMarkerUpdateInfo::canBeCompressed() const
{
return false;
}
......@@ -37,6 +37,7 @@ public:
virtual QRect dirtyViewportRect();
virtual QRect dirtyImageRect() const = 0;
virtual int levelOfDetail() const = 0;
virtual bool canBeCompressed() const;
};
Q_DECLARE_METATYPE(KisUpdateInfoSP)
......@@ -159,6 +160,7 @@ public:
QRect dirtyImageRect() const override;
int levelOfDetail() const override;
bool canBeCompressed() const override;
private:
Type m_type;
......
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