Commit e6c7f76b authored by Bart Coppens's avatar Bart Coppens

Increase speed for the erase paintop

svn path=/trunk/koffice/; revision=442976
parent 53e553aa
......@@ -30,6 +30,8 @@
#include "kis_painter.h"
#include "kis_types.h"
#include "kis_paintop.h"
#include "kis_iterators_pixel.h"
#include "kis_strategy_colorspace.h"
#include "kis_eraseop.h"
......@@ -104,12 +106,16 @@ void KisEraseOp::paintAt(const KisPoint &pos,
if (device -> hasAlpha()) {
dab -> setOpacity(OPACITY_OPAQUE);
for (int y = 0; y < maskHeight; y++) {
for (int x = 0; x < maskWidth; x++) {
// the color doesn't matter, since we only composite the alpha
dab -> setPixel(x, y, Qt::black, QUANTUM_MAX - mask->alphaAt(x, y));
}
KisRectIteratorPixel it = dab -> createRectIterator(0, 0, maskWidth, maskHeight, true);
KisProfileSP profile = dab -> profile();
KisStrategyColorSpace* cs = dab -> colorStrategy();
while (!it.isDone()) {
// the color doesn't matter, since we only composite the alpha
cs -> nativeColor(Qt::black, QUANTUM_MAX - mask->alphaAt(it.x(), it.y()),
it.rawData(), profile);
++it;
}
QRect dabRect = QRect(0, 0, maskWidth, maskHeight);
dstRect = QRect(destX, destY, dabRect.width(), dabRect.height());
......
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