[gegl] transform: fix composite transform chains with multiple consumers



commit d0b40b1d5967a7e85206b3e88fe2196c4f859b9e
Author: Ell <ell_se yahoo com>
Date:   Sun Apr 23 16:15:18 2017 -0400

    transform: fix composite transform chains with multiple consumers
    
    gegl_transform_is_composite_node() returns TRUE if the op's producer
    is a (suitable) transform op.  OTOH,
    gimp_transform_is_intermediate_node() returns TRUE only if *all* the
    op's consumers are transform ops.  In other words, if transform op A
    feeds to both transform op B and non-transform op C, A will not
    consider itself an intermediate node, while B *will* consider itself
    a composite node.  This results in double application of A's matrix:
    first by A, and again by B.
    
    Fix this by having gegl_transform_is_composite_node() check if the
    source node is an intermediate transform node (i.e., if all its
    consumers are transform ops.)

 operations/transform/transform-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index fa41a75..8c5cdea 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -413,7 +413,8 @@ gegl_transform_is_composite_node (OpTransform *transform)
 
   source = gegl_node_get_gegl_operation (source_node);
 
-  return (IS_OP_TRANSFORM (source) && transform->sampler == OP_TRANSFORM (source)->sampler);
+  return (IS_OP_TRANSFORM (source) &&
+          gegl_transform_is_intermediate_node (OP_TRANSFORM (source)));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]