[gegl] Move gegl_cache_computed() calls out of operations



commit 0836c517989cfbadf6e7da4fe0b21cda35a85bb5
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Thu Nov 14 06:25:52 2013 -0800

    Move gegl_cache_computed() calls out of operations

 gegl/operation/gegl-operation-composer.c        |    3 ---
 gegl/operation/gegl-operation-composer3.c       |    3 ---
 gegl/operation/gegl-operation-filter.c          |    4 +---
 gegl/operation/gegl-operation-point-composer.c  |   17 ++++-------------
 gegl/operation/gegl-operation-point-composer3.c |   17 ++++-------------
 gegl/operation/gegl-operation-point-filter.c    |    2 --
 gegl/operation/gegl-operation-source.c          |    3 ---
 gegl/process/gegl-graph-traversal.c             |    3 +++
 operations/common/exp-combine.c                 |    1 -
 9 files changed, 12 insertions(+), 41 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-composer.c b/gegl/operation/gegl-operation-composer.c
index 7f69583..3c9aa92 100644
--- a/gegl/operation/gegl-operation-composer.c
+++ b/gegl/operation/gegl-operation-composer.c
@@ -132,9 +132,6 @@ gegl_operation_composer_process (GeglOperation        *operation,
     {
       success = klass->process (operation, input, aux, output, result, level);
 
-      if (output == GEGL_BUFFER (operation->node->cache))
-        gegl_cache_computed (operation->node->cache, result);
-
       if (input)
         g_object_unref (input);
       if (aux)
diff --git a/gegl/operation/gegl-operation-composer3.c b/gegl/operation/gegl-operation-composer3.c
index 09ff63a..84d29e8 100644
--- a/gegl/operation/gegl-operation-composer3.c
+++ b/gegl/operation/gegl-operation-composer3.c
@@ -145,9 +145,6 @@ gegl_operation_composer3_process (GeglOperation        *operation,
     {
       success = klass->process (operation, input, aux, aux2, output, result, level);
 
-      if (output == GEGL_BUFFER (operation->node->cache))
-        gegl_cache_computed (operation->node->cache, result);
-
       if (input)
         g_object_unref (input);
       if (aux)
diff --git a/gegl/operation/gegl-operation-filter.c b/gegl/operation/gegl-operation-filter.c
index 5c801d9..89a0a42 100644
--- a/gegl/operation/gegl-operation-filter.c
+++ b/gegl/operation/gegl-operation-filter.c
@@ -136,11 +136,9 @@ gegl_operation_filter_process (GeglOperation        *operation,
 
   success = klass->process (operation, input, output, result, level);
 
-  if (output == GEGL_BUFFER (operation->node->cache))
-    gegl_cache_computed (operation->node->cache, result);
-
   if (input != NULL)
     g_object_unref (input);
+
   return success;
 }
 
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index eb04359..d872147 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -113,20 +113,11 @@ gegl_operation_composer_process2 (GeglOperation        *operation,
     output = gegl_operation_context_get_target (context, "output");
 
     {
-      gboolean done = FALSE;
+      if (result->width == 0 || result->height == 0)
+        success = TRUE;
+      else
+        success = klass->process (operation, input, aux, output, result, level);
 
-      if (result->width == 0 ||
-          result->height == 0)
-        done = TRUE;
-
-      success = done;
-      if (!done)
-        {
-          success = klass->process (operation, input, aux, output, result, level);
-
-          if (output == GEGL_BUFFER (operation->node->cache))
-            gegl_cache_computed (operation->node->cache, result);
-        }
       if (input)
          g_object_unref (input);
       if (aux)
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index 4f66587..93cef32 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -113,20 +113,11 @@ gegl_operation_composer3_process2 (GeglOperation        *operation,
       aux != NULL ||
       aux2 != NULL)
     {
-      gboolean done = FALSE;
-
-      if (result->width == 0 ||
-          result->height == 0)
-        done = TRUE;
-
-      success = done;
-      if (!done)
-        {
-          success = klass->process (operation, input, aux, aux2, output, result, context->level);
+      if (result->width == 0 || result->height == 0)
+        success = TRUE;
+      else
+        success = klass->process (operation, input, aux, aux2, output, result, context->level);
 
-          if (output == GEGL_BUFFER (operation->node->cache))
-            gegl_cache_computed (operation->node->cache, result);
-        }
       if (input)
          g_object_unref (input);
       if (aux)
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 0983ec4..8f5a0a4 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -220,8 +220,6 @@ static gboolean gegl_operation_point_filter_op_process
     }
 
   success = gegl_operation_point_filter_process (operation, input, output, roi, level);
-  if (output == GEGL_BUFFER (operation->node->cache))
-    gegl_cache_computed (operation->node->cache, roi);
 
   if (input != NULL)
     g_object_unref (input);
diff --git a/gegl/operation/gegl-operation-source.c b/gegl/operation/gegl-operation-source.c
index c4e01c2..c1843b7 100644
--- a/gegl/operation/gegl-operation-source.c
+++ b/gegl/operation/gegl-operation-source.c
@@ -103,9 +103,6 @@ gegl_operation_source_process (GeglOperation        *operation,
   output = gegl_operation_context_get_target (context, "output");
   success = klass->process (operation, output, result, level);
 
-  if (output == GEGL_BUFFER (operation->node->cache))
-    gegl_cache_computed (operation->node->cache, result);
-
   return success;
 }
 
diff --git a/gegl/process/gegl-graph-traversal.c b/gegl/process/gegl-graph-traversal.c
index 5895054..82a339a 100644
--- a/gegl/process/gegl-graph-traversal.c
+++ b/gegl/process/gegl-graph-traversal.c
@@ -416,6 +416,9 @@ gegl_graph_process (GeglGraphTraversal *path)
 
               gegl_operation_process (operation, context, "output", &context->need_rect, context->level);
               operation_result = GEGL_BUFFER (gegl_operation_context_get_object (context, "output"));
+
+              if (operation_result && operation_result == (GeglBuffer *)operation->node->cache)
+                gegl_cache_computed (operation->node->cache, &context->need_rect);
             }
         }
       else
diff --git a/operations/common/exp-combine.c b/operations/common/exp-combine.c
index 6e652e8..d0dc799 100644
--- a/operations/common/exp-combine.c
+++ b/operations/common/exp-combine.c
@@ -1182,7 +1182,6 @@ gegl_expcombine_process (GeglOperation        *operation,
   /* Save the HDR components to the output buffer. */
   gegl_buffer_set (output, full_roi, 0, babl_format (PAD_FORMAT), hdr,
                    GEGL_AUTO_ROWSTRIDE);
-  gegl_cache_computed (gegl_node_get_cache (operation->node), full_roi);
 
   /* Cleanup */
   g_free (hdr);


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