Commit Graph

7 Commits

Author SHA1 Message Date
Ell
522e497457 app: in GimpChunkIterator, avoid preparing rect before merging
In GimpChunkIterator, avoid preparing the current rect before
merging it back to the iterator's region, to save some work.

Additionally, strengthen the iterator's invariants and simplify
code.

(cherry picked from commit c95502266a)
2019-03-31 05:03:47 -04:00
Ell
191c9812f3 app: small fix to GimpChunkIterator
(cherry picked from commit d182c41f8f)
2019-03-30 16:36:33 -04:00
Ell
4d2a5d1a94 app: more responsiveness improvements to GimpChunkIterator
Improve GimpChunkIterator's responsiveness to changes in processing
speed.

(cherry picked from commit 91f4c809d8)
2019-03-30 11:18:05 -04:00
Ell
7c6125ce67 app: improve responsiveness of GimpChunkIterator
In GimpChunkIterator, redajust the target area at each step,
instead of at each iteration, to adapt more quickly to the current
processing speed.  To avoid creating uneven chunks as a result,
only change the chunk height at the beginning of rows, unless the
resulting area would be more than twice as big as the target area.

(cherry picked from commit e904b71242)
2019-03-27 15:47:38 -04:00
Ell
4cbec7608f app: fix gimp_chunk_iterator_set_priority_rect()
(cherry picked from commit 942e1aa939)
2019-01-12 07:32:08 -05:00
Ell
5e00c26295 app: in gimpchunkiterator.c, #include <stdlib.h>
... for qsort().

(cherry picked from commit a61f29e30a)
2019-01-12 06:16:50 -05:00
Ell
8c31ed6f02 app: add GimpChunkIterator
Factor out the region-chunking logic of GimpProjection into a new
GimpChunkIterator type, providing a generic mechanism for iterating
over a cairo region in discrete chunks.  The iterator doesn't
perform any processing itself, but rather dispenses rectangular
chunks, which the user then processes.

Iteration is broken into intervals, the duration of which is
configurable.  Each iteration begins with a call to
gimp_chunk_iterator_next(), after which
gimp_chunk_iterator_get_rect() should be called in succession to
fetch a rectangle to process, until it returns FALSE, which marks
the end of the iteration.  Updates to the UI should take place in
the interval between iterations, but not during an iteration.  The
iterator dynamically adjusts the chunk size according to processing
speed, in order to match the target iteration interval.

The iterator can be given a priority rectangle, which is processed
before the rest of the region.  It can also be given a
representative tile rectangle, defining a regular tile grid;
dispensed chunks are aligned to the tile grid as much as possible.

(cherry picked from commit ba9ce34e10)
2019-01-12 04:53:10 -05:00