Incremental painting in paint tools

Dmitry Kazakov dimula73 at gmail.com
Thu Jun 25 12:14:15 CEST 2009


>
> Thanks for help!
> Now it's not so strange =)
>

Strange again..

It seems that KisFreehandTool writes into original layer _twice_ during
non-incremental painting.
First, here:

void KisToolFreehand::setDirty(const QRegion& region)
{
    if (region.numRects() < 1)
        return;

    if (!m_paintOnSelection) {
// SOME DATA BitBlt'ed into original layer here
        currentNode()->setDirty(region);
    } else {
      /// skipped
      ///...
    }
}

And second time, when painting is finished, in KisToolFreehand::endPaint()
...
            painter.beginTransaction(m_transactionText);

      QRegion r = m_incrementalDirtyRegion;
      QVector<QRect> dirtyRects = r.rects();
      QVector<QRect>::iterator it = dirtyRects.begin();
      QVector<QRect>::iterator end = dirtyRects.end();

      while (it != end) {

          painter.bitBlt(it->x(), it->y(), m_compositeOp, m_target,
                               m_opacity,
                               it->x(), it->y(),
                               it->width(), it->height());
          ++it;
      }
...

Could you explain me what this code does? And why we write into original
layer twice?

I get some strange stuff because of that, as first write access is done
without any mementoing at all. I mean no transaction opened during this
write! And this is quite strange for me...



-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20090625/9ae3fc7e/attachment.htm 


More information about the kimageshop mailing list