gegl_buffer_set_pattern allocates large scratch buffers
Submitted by Téo Mazars
Link to original bug (#712814)
Description
Created attachment 260442 Improve gegl_buffer_set_pattern
The current implementation of gegl_buffer_set_pattern is not correct:
Among other things:
- the whole buffer is filled, no matter of the rect input (which is simply ignored)
- offsets are directly casted to int
See attached a suggested implementation of the function, which copies the pattern only once at the begining, and then copies the buffer from/to itself with growing regions. The goal is to reduce the number of call to gegl_buffer_copy, and also to limit the number of conversions from pattern's babl format to the buffer pixel format.
Opinions ?
The patch is submitted for review and inclusion against master.
Patch 260442, "Improve gegl_buffer_set_pattern":
0001-buffers-improve-gegl_buffer_set_pattern.patch
Version: git master