Skip to content
Commit f352cc1d authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Refactor KisSequentialIterator to use java-style iteration

This patch touches quite a lot of stuff throughout the entire Krita,
please report any crashes you get because of that!

Technical details:

The sequential iterator (alongside the hline and vline) iterators had
an inherent problem: when called with an empty rect it just crashed
with SIGSEGV (hlive and vline iterators just have a hack to read/write
at least one pixel when called with an empty rect). This problem happens
because of the structure of API we use: we call nextPixel() **after** the
first cycle of iteration, that is we will read/write at least one pixel
even when the requested rect is empty(!).

Now the iterator inserts one "virtual" pixel before every iteration that
allows the user to call nextPixel() **before** the the first iteration
and stop the cycle in case the check fails.

See example code snippets in kis_sequential_iterator.h

CC:kimageshop@kde.org
BUG:388272
parent 434e1a69
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