• Dmitry Kazakov's avatar
    Refactor KisSequentialIterator to use java-style iteration · f352cc1d
    Dmitry Kazakov authored
    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