I think it would be quite good idea to make a rule to add the author of reverted patch to CC at least. I might have been unavailable on irc, but I still have to know about such reverts. I knew about it quite accidentally.<br>
<br>The commit might slow down painting with very small brushes, but it optimizes big brushes. The revert makes just the opposite. So i would try to make some benchmarking before doing anything with this code.<br><br><div class="gmail_quote">
On Wed, Jun 1, 2011 at 7:41 PM, Boudewijn Rempt <span dir="ltr"><<a href="mailto:boud@valdyas.org">boud@valdyas.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Git commit 1a847037f48ce47d221c5abb351fd2d918d66dee by Boudewijn Rempt.<br>
Committed on 30/05/2011 at 16:08.<br>
Pushed by rempt into branch 'master'.<br>
<br>
Revert "Let dirty rect to be a QRegion instead of a QRect"<br>
<br>
This reverts commit a56c0ab64ca1290b034e863439319d38daddefab.<br>
<br>
This commit caused a visible performance degradation according to<br>
research done by Cyrille..<br>
<br>
M +25 -5 krita/image/kis_painter.cc<br>
<br>
<a href="http://commits.kde.org/calligra/1a847037f48ce47d221c5abb351fd2d918d66dee" target="_blank">http://commits.kde.org/calligra/1a847037f48ce47d221c5abb351fd2d918d66dee</a><br>
<br>
diff --git a/krita/image/kis_painter.cc b/krita/image/kis_painter.cc<br>
index 652f66e..3328aff 100644<br>
--- a/krita/image/kis_painter.cc<br>
+++ b/krita/image/kis_painter.cc<br>
@@ -79,6 +79,7 @@ struct KisPainter::Private {<br>
KoUpdater* progressUpdater;<br>
<br>
QRegion dirtyRegion;<br>
+ QRect dirtyRect;<br>
KisPaintOp* paintOp;<br>
QRect bounds;<br>
KoColor paintColor;<br>
@@ -97,6 +98,7 @@ struct KisPainter::Private {<br>
KoColorProfile* profile;<br>
const KoCompositeOp* compositeOp;<br>
QBitArray channelFlags;<br>
+ bool useBoundingDirtyRect;<br>
const KoAbstractGradient* gradient;<br>
KisPaintOpPresetSP paintOpPreset;<br>
QImage polygonMaskImage;<br>
@@ -153,6 +155,9 @@ void KisPainter::init()<br>
d->maskImageHeight = 255;<br>
d->mirrorHorizontaly = false;<br>
d->mirrorVerticaly = false;<br>
+<br>
+ KConfigGroup cfg = KGlobal::config()->group("");<br>
+ d->useBoundingDirtyRect = cfg.readEntry("aggregate_dirty_regions", true);<br>
}<br>
<br>
KisPainter::~KisPainter()<br>
@@ -243,9 +248,16 @@ KisTransaction* KisPainter::takeTransaction()<br>
<br>
QRegion KisPainter::takeDirtyRegion()<br>
{<br>
- QRegion r = d->dirtyRegion;<br>
- d->dirtyRegion = QRegion();<br>
- return r;<br>
+ if (d->useBoundingDirtyRect) {<br>
+ QRegion r(d->dirtyRect);<br>
+ d->dirtyRegion = QRegion();<br>
+ d->dirtyRect = QRect();<br>
+ return r;<br>
+ } else {<br>
+ QRegion r = d->dirtyRegion;<br>
+ d->dirtyRegion = QRegion();<br>
+ return r;<br>
+ }<br>
}<br>
<br>
<br>
@@ -257,11 +269,19 @@ QRegion KisPainter::addDirtyRect(const QRect & rc)<br>
return d->dirtyRegion;<br>
}<br>
<br>
- d->dirtyRegion += r;<br>
- return d->dirtyRegion;<br>
+ if (d->useBoundingDirtyRect) {<br>
+ d->dirtyRect = d->dirtyRect.united(r);<br>
+ return QRegion(d->dirtyRect);<br>
+ } else {<br>
+ d->dirtyRegion += QRegion(r);<br>
+ return d->dirtyRegion;<br>
+ }<br>
}<br>
<br>
<br>
+<br>
+<br>
+<br>
void KisPainter::bitBltWithFixedSelection(qint32 dstX, qint32 dstY,<br>
const KisPaintDeviceSP srcDev,<br>
const KisFixedPaintDeviceSP selection,<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Dmitry Kazakov<br>