Commit 53b48009 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Optimize non-antialiased case in Flood Selection tool

We should use KisSequentialIterator whenever is possible, it is
twice faster than normal hline-iterator.
parent 8c5dcfe9
......@@ -149,16 +149,11 @@ void KisToolSelectContiguous::beginPrimaryAction(KoPointerEvent *event)
// If we're not antialiasing, threshold the entire selection
if (!antiAlias) {
QRect r = selection->selectedExactRect();
if (r.isValid()) {
KisHLineIteratorSP selectionIt = selection->createHLineIteratorNG(r.x(), r.y(), r.width());
for (qint32 y = 0; y < r.height(); y++) {
do {
if (selectionIt->rawData()[0] > 0) {
selection->colorSpace()->setOpacity(selectionIt->rawData(), OPACITY_OPAQUE_U8, 1);
}
} while (selectionIt->nextPixel());
selectionIt->nextRow();
const QRect r = selection->selectedExactRect();
KisSequentialIterator it (selection, r);
while(it.nextPixel()) {
if (*it.rawData() > 0) {
*it.rawData() = OPACITY_OPAQUE_U8;
}
}
}
......
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