[gegl] recursive-transform: cache iteration results when performing multiple transforms



commit 1381a26a038493620b6c7bcb27af6199322b0c8d
Author: Ell <ell_se yahoo com>
Date:   Fri Feb 22 03:13:22 2019 -0500

    recursive-transform: cache iteration results when performing multiple transforms
    
    In gegl:recursive-transform, cache the results of intermediate
    iterations when performing multiple transforms in each iteration,
    to avoid processing the same iterations multiple times when working
    in chunks.

 operations/common/recursive-transform.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/operations/common/recursive-transform.c b/operations/common/recursive-transform.c
index e69177ccf..2197e2e09 100644
--- a/operations/common/recursive-transform.c
+++ b/operations/common/recursive-transform.c
@@ -95,6 +95,10 @@ update_graph (GeglOperation *operation)
     {
       for (j = MAX_TRANSFORMS - 1; j >= 0; j--)
         {
+          g_object_set (iters[i].over_nodes[j],
+                        "cache-policy", GEGL_CACHE_POLICY_AUTO,
+                        NULL);
+
           gegl_node_disconnect (iters[i].over_nodes[j],    "input");
           gegl_node_disconnect (iters[i].over_nodes[j],    "aux");
         }
@@ -276,6 +280,13 @@ update_graph (GeglOperation *operation)
               gegl_node_connect_to (source_node,                           "output",
                                     iters[i].over_nodes[n_transforms - 1], ! o->paste_below ? "aux" :
                                                                                               "input");
+
+              if (i > 0)
+                {
+                  g_object_set (iters[i].over_nodes[n_transforms - 1],
+                                "cache-policy", GEGL_CACHE_POLICY_ALWAYS,
+                                NULL);
+                }
             }
 
           if (i >= o->first_iteration)


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