diff --git a/app/paint/gimppaintcore-loops.cc b/app/paint/gimppaintcore-loops.cc index 0a46e7c433..a6548c7cdf 100644 --- a/app/paint/gimppaintcore-loops.cc +++ b/app/paint/gimppaintcore-loops.cc @@ -329,6 +329,41 @@ struct AlgorithmBase gint y) const { } + + /* The 'finalize_step()' function is called once per chunk after its + * processing is done, and should finalize any chunk-specific resources of + * the state object. + * + * 'params' is the same parameter struct passed to the constructor. 'state' + * is the state object. + * + * An algorithm that overrides this function should call the + * 'finalize_step()' function of its base class after performing its own + * finalization, using the same arguments. + */ + template + void + finalize_step (const GimpPaintCoreLoopsParams *params, + State *state) const + { + } + + /* The 'finalize()' function is called once per state object after processing + * is done, and should finalize the state object. + * + * 'params' is the same parameter struct passed to the constructor. 'state' + * is the state object. + * + * An algorithm that overrides this function should call the 'finalize()' + * function of its base class after performing its own finalization, using + * the same arguments. + */ + template + void + finalize (const GimpPaintCoreLoopsParams *params, + State *state) const + { + } }; @@ -1184,7 +1219,11 @@ gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params, iter, &roi, area, rect, rect->y + y); } + + algorithm.finalize_step (params, &state); } + + algorithm.finalize (params, &state); } else { @@ -1197,6 +1236,9 @@ gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params, NULL, &roi, area, area, area->y + y); } + + algorithm.finalize_step (params, &state); + algorithm.finalize (params, &state); } }); },