Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Process squares in the correct order in Liquify

Agata Cackoca32b6713110
diff --git a/libs/image/kis_grid_interpolation_tools.h b/libs/image/kis_grid_interpolation_tools.h
index d90dabf1ac..f1be4904ca 100644
--- a/libs/image/kis_grid_interpolation_tools.h
+++ b/libs/image/kis_grid_interpolation_tools.h
@@ -244,6 +244,12 @@ struct PaintDevicePolygonOp
}
+ // provess previous rects so they are all processed
+ // in the same order as without any performance improvements
+ // (according to the grid processing order)
+ copyPreviousRects();
+
+
KisSequentialIterator dstIt(m_dstDev, boundRect);
KisRandomSubAccessorSP srcAcc = m_srcDev->createRandomSubAccessor();
@@ -314,8 +320,7 @@ struct PaintDevicePolygonOp
}
- void finalize() {
-
+ void copyPreviousRects() {
QVector<QRect>::iterator end = KisRegion::mergeSparseRects(m_rectsToCopy.begin(), m_rectsToCopy.end());
for (QVector<QRect>::iterator it = m_rectsToCopy.begin(); it < end; it++) {
@@ -325,6 +330,10 @@ struct PaintDevicePolygonOp
m_rectsToCopy = QVector<QRect>();
}
+ void finalize() {
+ copyPreviousRects();
+ }
+
inline void setCanMergeRects(bool newCanMergeRects) {
m_canMergeRects = newCanMergeRects;
}
@@ -462,6 +471,10 @@ struct QImagePolygonOp
return;
}
+ // provess previous rects so they are all processed
+ // in the same order as without any performance improvements
+ copyPreviousRects();
+
KisFourPointInterpolatorBackward interp(srcPolygon, dstPolygon);
for (int y = boundRect.top(); y <= boundRect.bottom(); y++) {
@@ -506,7 +519,7 @@ struct QImagePolygonOp
}
- void finalize() {
+ void copyPreviousRects() {
QVector<QRect>::iterator end = KisRegion::mergeSparseRects(m_rectsToCopy.begin(), m_rectsToCopy.end());
@@ -518,6 +531,10 @@ struct QImagePolygonOp
m_rectsToCopy = QVector<QRect>();
}
+ void finalize() {
+ copyPreviousRects();
+ }
+
inline void setCanMergeRects(bool canMergeRects) {
m_canMergeRects = canMergeRects;
}