app: in gimppaintcore-loops, make sure dest_buffer is the primary iterator buffer
In gimppaintcore-loops, in the DO_LAYER_BLEND paint algorithm, and
in the CanvasBufferIterator algorithm helper-class, initialize the
iterator *before* initializing the base class, to make sure that
dest_buffer, or canvas_buffer, respectively and in that order, is
the primary buffer of the iterator. In particular, this avoids the
mask buffer being the primary buffer. This is desirable, since
most of the buffers we iterate over are tile-aligned to the dest/
canvas buffers.
(cherry picked from commit f9c072c328)
This commit is contained in:
parent
aa7de29f9e
commit
d4cb2d57bd
1 changed files with 12 additions and 4 deletions
|
|
@ -907,11 +907,15 @@ struct CanvasBufferIterator<Base, Access, 0> : Base
|
|||
const GeglRectangle *roi,
|
||||
const GeglRectangle *area) const
|
||||
{
|
||||
Base::init (params, state, iter, roi, area);
|
||||
|
||||
state->canvas_buffer_iterator = gegl_buffer_iterator_add (
|
||||
iter, params->canvas_buffer, area, 0, babl_format ("Y float"),
|
||||
Derived::canvas_buffer_access, GEGL_ABYSS_NONE);
|
||||
|
||||
/* initialize the base class *after* initializing the iterator, to make
|
||||
* sure that canvas_buffer is the primary buffer of the iterator, if no
|
||||
* subclass added an iterator first.
|
||||
*/
|
||||
Base::init (params, state, iter, roi, area);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1317,8 +1321,6 @@ struct DoLayerBlend : Base
|
|||
const GeglRectangle *roi,
|
||||
const GeglRectangle *area) const
|
||||
{
|
||||
Base::init (params, state, iter, roi, area);
|
||||
|
||||
state->iterator_base = gegl_buffer_iterator_add (iter, params->dest_buffer,
|
||||
area, 0, iterator_format,
|
||||
GEGL_ACCESS_WRITE,
|
||||
|
|
@ -1327,6 +1329,12 @@ struct DoLayerBlend : Base
|
|||
gegl_buffer_iterator_add (iter, params->src_buffer, area, 0,
|
||||
iterator_format,
|
||||
GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
|
||||
|
||||
/* initialize the base class *after* initializing the iterator, to make
|
||||
* sure that dest_buffer is the primary buffer of the iterator, if no
|
||||
* subclass added an iterator first.
|
||||
*/
|
||||
Base::init (params, state, iter, roi, area);
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
|
|
|
|||
Loading…
Reference in a new issue