[gimp/gimp-2-10] app: in gimppaintcore-loops, make CanvasBufferIterator self-contained
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: in gimppaintcore-loops, make CanvasBufferIterator self-contained
- Date: Tue, 12 Feb 2019 14:29:14 +0000 (UTC)
commit deda2699b9945fff56034ed3cba1653e83a8cd78
Author: Ell <ell_se yahoo com>
Date: Mon Feb 11 09:27:04 2019 -0500
app: in gimppaintcore-loops, make CanvasBufferIterator self-contained
In gimppaintcore-loops, make the CanvasBufferIterator algorithm
helper-class self-contained, not having to rely on AlgorithmBase.
(cherry picked from commit 0d1f7241121e4c027402eb5c9fce5aa6e8cd997e)
app/paint/gimppaintcore-loops.cc | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
---
diff --git a/app/paint/gimppaintcore-loops.cc b/app/paint/gimppaintcore-loops.cc
index 7d03890223..74745a5eb7 100644
--- a/app/paint/gimppaintcore-loops.cc
+++ b/app/paint/gimppaintcore-loops.cc
@@ -230,16 +230,13 @@ struct AlgorithmBase
* Algorithms that redefine 'filter' should bitwise-OR their filter with that
* of their base class.
*/
- static constexpr guint filter = 0;
-
- /* See CanvasBufferIterator. */
- static constexpr GeglAccessMode canvas_buffer_access = {};
+ static constexpr guint filter = 0;
/* The current maximal number of iterators used by the hierarchy. Algorithms
* should redefine 'max_n_iterators' by adding the maximal number of
* iterators they use to this value.
*/
- static constexpr gint max_n_iterators = 0;
+ static constexpr gint max_n_iterators = 0;
/* Non-static data members should be initialized in the constructor, and
* should not be further modified.
@@ -556,14 +553,34 @@ struct DispatchStipple
template <class Base,
guint Access,
- guint BaseAccess = Base::canvas_buffer_access>
+ guint BaseAccess>
+struct CanvasBufferIterator;
+
+template <class Base,
+ guint Access,
+ guint BaseAccess>
+static constexpr GeglAccessMode
+canvas_buffer_iterator_access (CanvasBufferIterator<Base, Access, BaseAccess> *algorithm)
+{
+ return CanvasBufferIterator<Base, Access, BaseAccess>::canvas_buffer_access;
+}
+
+static constexpr GeglAccessMode
+canvas_buffer_iterator_access (AlgorithmBase *algorithm)
+{
+ return {};
+}
+
+template <class Base,
+ guint Access,
+ guint BaseAccess = canvas_buffer_iterator_access ((Base *) NULL)>
struct CanvasBufferIterator : Base
{
/* The combined canvas-buffer access mode used by the hierarchy, up to, and
* including, the current class.
*/
static constexpr GeglAccessMode canvas_buffer_access =
- (GeglAccessMode) (Base::canvas_buffer_access | Access);
+ (GeglAccessMode) (BaseAccess | Access);
using Base::Base;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]