[gimp] app: in gimppaintcore-loops, make sure dest_buffer is the primary iterator buffer
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: in gimppaintcore-loops, make sure dest_buffer is the primary iterator buffer
- Date: Tue, 12 Feb 2019 14:30:46 +0000 (UTC)
commit f9c072c328666d332ea46212336394f33d474072
Author: Ell <ell_se yahoo com>
Date: Mon Feb 11 03:42:16 2019 -0500
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.
app/paint/gimppaintcore-loops.cc | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/app/paint/gimppaintcore-loops.cc b/app/paint/gimppaintcore-loops.cc
index db0b3282ca..35ba59f71d 100644
--- a/app/paint/gimppaintcore-loops.cc
+++ b/app/paint/gimppaintcore-loops.cc
@@ -909,11 +909,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);
}
};
@@ -1319,8 +1323,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,
@@ -1329,6 +1331,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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]