[gegl] operations: replace use of no_cache with cache_policy



commit 0f0d193a5dec85d7865a8328601ead460f0b63f5
Author: Ell <ell_se yahoo com>
Date:   Thu Feb 21 13:00:57 2019 -0500

    operations: replace use of no_cache with cache_policy
    
    In all operations, replace the use of the deprecated
    GeglOperationClass::no_cache with GeglOperationClass::cache_policy.
    
    For ops that don't have a reason to control caching directly,
    remove cache-policy setting altogether.

 operations/common/buffer-source.c         | 2 +-
 operations/common/copy-buffer.c           | 8 ++++----
 operations/common/edge-neon.c             | 2 +-
 operations/common/linear-gradient.c       | 1 -
 operations/common/magick-load.c           | 1 -
 operations/common/noise-perlin.c          | 2 --
 operations/common/open-buffer.c           | 2 +-
 operations/common/radial-gradient.c       | 1 -
 operations/common/vignette.c              | 1 -
 operations/core/cache.c                   | 2 +-
 operations/core/cast-format.c             | 5 ++---
 operations/core/cast-space.c              | 5 ++---
 operations/core/clone.c                   | 2 +-
 operations/core/convert-format.c          | 7 +++----
 operations/core/crop.c                    | 2 +-
 operations/core/load.c                    | 1 -
 operations/external/path.c                | 2 +-
 operations/external/pixbuf.c              | 2 +-
 operations/external/vector-stroke.c       | 2 +-
 operations/transform/transform-core.c     | 1 -
 operations/workshop/external/spyrograph.c | 2 +-
 21 files changed, 21 insertions(+), 32 deletions(-)
---
diff --git a/operations/common/buffer-source.c b/operations/common/buffer-source.c
index 96f9d9717..d73fccc9c 100644
--- a/operations/common/buffer-source.c
+++ b/operations/common/buffer-source.c
@@ -221,7 +221,7 @@ gegl_op_class_init (GeglOpClass *klass)
       "description", _("Use an existing in-memory GeglBuffer as image source."),
       NULL);
 
-  operation_class->no_cache = TRUE;
+  operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;
 }
 
 #endif
diff --git a/operations/common/copy-buffer.c b/operations/common/copy-buffer.c
index 0796fb517..73ab96a63 100644
--- a/operations/common/copy-buffer.c
+++ b/operations/common/copy-buffer.c
@@ -143,10 +143,10 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class = GEGL_OPERATION_CLASS (klass);
   filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
 
-  operation_class->prepare  = prepare;
-  operation_class->no_cache = TRUE;
-  operation_class->threaded = FALSE;
-  filter_class->process     = process;
+  operation_class->prepare      = prepare;
+  operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;
+  operation_class->threaded     = FALSE;
+  filter_class->process         = process;
 
   gegl_operation_class_set_keys (operation_class,
     "name",           "gegl:copy-buffer",
diff --git a/operations/common/edge-neon.c b/operations/common/edge-neon.c
index 7b84c7147..a258b411d 100644
--- a/operations/common/edge-neon.c
+++ b/operations/common/edge-neon.c
@@ -546,7 +546,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->opencl_support          = 0;
   operation_class->threaded                = 0; //Due to IIR Implementation (smear-carry), we require 
single-process, linear operation.
   operation_class->want_in_place           = 0; //IIR Causes buffer build-up.
-  operation_class->no_cache                = 1; //IIR Causes buffer build-up.
+  operation_class->cache_policy            = GEGL_CACHE_POLICY_NEVER; //IIR Causes buffer build-up.
 
   gegl_operation_class_set_keys (operation_class,
     "name",       "gegl:edge-neon",
diff --git a/operations/common/linear-gradient.c b/operations/common/linear-gradient.c
index 762ea40a9..9a1c579fa 100644
--- a/operations/common/linear-gradient.c
+++ b/operations/common/linear-gradient.c
@@ -133,7 +133,6 @@ gegl_op_class_init (GeglOpClass *klass)
   point_render_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
-  operation_class->no_cache = TRUE;
 
   gegl_operation_class_set_keys (operation_class,
     "name",               "gegl:linear-gradient",
diff --git a/operations/common/magick-load.c b/operations/common/magick-load.c
index d17da9c51..e2055b2e9 100644
--- a/operations/common/magick-load.c
+++ b/operations/common/magick-load.c
@@ -136,7 +136,6 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->get_cached_region = get_cached_region;;
-  operation_class->no_cache = FALSE;
 
   gegl_operation_class_set_keys (operation_class,
         "name"       , "gegl:magick-load",
diff --git a/operations/common/noise-perlin.c b/operations/common/noise-perlin.c
index 5da21f007..d25dd1a72 100644
--- a/operations/common/noise-perlin.c
+++ b/operations/common/noise-perlin.c
@@ -103,8 +103,6 @@ gegl_op_class_init (GeglOpClass *klass)
   point_render_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
-  operation_class->no_cache = TRUE;
-  operation_class->get_cached_region = NULL;
 
   gegl_operation_class_set_keys (operation_class,
     "name",               "gegl:perlin-noise",
diff --git a/operations/common/open-buffer.c b/operations/common/open-buffer.c
index a80c8ea07..b703ba44e 100644
--- a/operations/common/open-buffer.c
+++ b/operations/common/open-buffer.c
@@ -133,7 +133,7 @@ gegl_op_class_init (GeglOpClass *klass)
     "description", _("Use an on-disk GeglBuffer as data source."),
     NULL);
 
-  operation_class->no_cache = TRUE;
+  operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;
 }
 
 #endif
diff --git a/operations/common/radial-gradient.c b/operations/common/radial-gradient.c
index 3f19948d9..0383c7840 100644
--- a/operations/common/radial-gradient.c
+++ b/operations/common/radial-gradient.c
@@ -120,7 +120,6 @@ gegl_op_class_init (GeglOpClass *klass)
   point_render_class->process       = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare          = prepare;
-  operation_class->no_cache         = TRUE;
 
   gegl_operation_class_set_keys (operation_class,
     "name",          "gegl:radial-gradient",
diff --git a/operations/common/vignette.c b/operations/common/vignette.c
index 8b5cdde79..8297c43e6 100644
--- a/operations/common/vignette.c
+++ b/operations/common/vignette.c
@@ -374,7 +374,6 @@ gegl_op_class_init (GeglOpClass *klass)
   point_filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
 
   operation_class->prepare        = prepare;
-  operation_class->no_cache       = TRUE;
   operation_class->opencl_support = TRUE;
 
   point_filter_class->process    = process;
diff --git a/operations/core/cache.c b/operations/core/cache.c
index 8c2534de6..928131443 100644
--- a/operations/core/cache.c
+++ b/operations/core/cache.c
@@ -77,7 +77,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class    = GEGL_OPERATION_CLASS (klass);
   point_filter_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
 
-  operation_class->no_cache      = FALSE;
+  operation_class->cache_policy  = GEGL_CACHE_POLICY_ALWAYS;
   operation_class->want_in_place = FALSE;
   operation_class->threaded      = FALSE;
   operation_class->prepare       = prepare;
diff --git a/operations/core/cast-format.c b/operations/core/cast-format.c
index de640dd6a..f48f8ce28 100644
--- a/operations/core/cast-format.c
+++ b/operations/core/cast-format.c
@@ -102,9 +102,8 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
 
-  operation_class->prepare  = prepare;
-  operation_class->process  = process;
-  operation_class->no_cache = FALSE;
+  operation_class->prepare = prepare;
+  operation_class->process = process;
 
   gegl_operation_class_set_keys (operation_class,
     "name",       "gegl:cast-format",
diff --git a/operations/core/cast-space.c b/operations/core/cast-space.c
index 731872307..d2b465358 100644
--- a/operations/core/cast-space.c
+++ b/operations/core/cast-space.c
@@ -120,9 +120,8 @@ gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
 
-  operation_class->prepare  = prepare;
-  operation_class->process  = process;
-  operation_class->no_cache = FALSE;
+  operation_class->prepare = prepare;
+  operation_class->process = process;
 
   gegl_operation_class_set_keys (operation_class,
     "name",       "gegl:cast-space",
diff --git a/operations/core/clone.c b/operations/core/clone.c
index ca313035e..e5e42b3be 100644
--- a/operations/core/clone.c
+++ b/operations/core/clone.c
@@ -103,7 +103,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->detect = detect;
-  operation_class->no_cache = TRUE;
+  operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;
 
   gegl_operation_class_set_keys (operation_class,
        "name",          "gegl:clone",
diff --git a/operations/core/convert-format.c b/operations/core/convert-format.c
index 0a8a92e5a..fabeb436a 100644
--- a/operations/core/convert-format.c
+++ b/operations/core/convert-format.c
@@ -89,11 +89,10 @@ gegl_op_class_init (GeglOpClass *klass)
   GeglOperationClass       *operation_class = GEGL_OPERATION_CLASS (klass);
   GeglOperationFilterClass *filter_class    = GEGL_OPERATION_FILTER_CLASS (klass);
 
-  operation_class->prepare  = prepare;
-  operation_class->process  = operation_process;
-  operation_class->no_cache = FALSE;
+  operation_class->prepare = prepare;
+  operation_class->process = operation_process;
 
-  filter_class->process     = process;
+  filter_class->process    = process;
 
   gegl_operation_class_set_keys (operation_class,
                 "name",       "gegl:convert-format",
diff --git a/operations/core/crop.c b/operations/core/crop.c
index abf35e2ca..e8ef972d8 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -250,7 +250,7 @@ gegl_op_class_init (GeglOpClass *klass)
       "reference-composition", composition,
       NULL);
 
-  operation_class->no_cache = TRUE;
+  operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;
 }
 
 #endif
diff --git a/operations/core/load.c b/operations/core/load.c
index 5708d8f02..47d02ba7b 100644
--- a/operations/core/load.c
+++ b/operations/core/load.c
@@ -357,7 +357,6 @@ gegl_op_class_init (GeglOpClass *klass)
 
   operation_class->attach = attach;
   operation_class->detect = detect;
-  operation_class->no_cache = TRUE;
 
   gegl_operation_class_set_keys (operation_class,
     "name"       , "gegl:load",
diff --git a/operations/external/path.c b/operations/external/path.c
index c01b2f0f0..fcc18d004 100644
--- a/operations/external/path.c
+++ b/operations/external/path.c
@@ -578,7 +578,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
   operation_class->detect = detect;
-  /*operation_class->no_cache = TRUE;*/
+  /*operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;*/
 
   gegl_operation_class_set_keys (operation_class,
     "name",           "gegl:path",
diff --git a/operations/external/pixbuf.c b/operations/external/pixbuf.c
index 912d93589..3d0b0eeb3 100644
--- a/operations/external/pixbuf.c
+++ b/operations/external/pixbuf.c
@@ -102,7 +102,7 @@ gegl_op_class_init (GeglOpClass *klass)
   source_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
-  /*operation_class->no_cache = TRUE;*/
+  /*operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;*/
 
   gegl_operation_class_set_keys (operation_class,
     "name",         "gegl:pixbuf",
diff --git a/operations/external/vector-stroke.c b/operations/external/vector-stroke.c
index 90e65b53b..6492c289f 100644
--- a/operations/external/vector-stroke.c
+++ b/operations/external/vector-stroke.c
@@ -348,7 +348,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
   operation_class->detect = detect;
-  /*operation_class->no_cache = TRUE;*/
+  /*operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;*/
 
   gegl_operation_class_set_keys (operation_class,
     "name",                  "gegl:vector-stroke",
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index eb3fa88d9..7e0c60319 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -195,7 +195,6 @@ op_transform_class_init (OpTransformClass *klass)
   op_class->detect                    = gegl_transform_detect;
   op_class->process                   = gegl_transform_process;
   op_class->prepare                   = gegl_transform_prepare;
-  op_class->no_cache                  = TRUE;
   op_class->threaded                  = TRUE;
 
   klass->create_matrix                = NULL;
diff --git a/operations/workshop/external/spyrograph.c b/operations/workshop/external/spyrograph.c
index 143ee05cb..7188bd70a 100644
--- a/operations/workshop/external/spyrograph.c
+++ b/operations/workshop/external/spyrograph.c
@@ -605,7 +605,7 @@ gegl_op_class_init (GeglOpClass *klass)
   operation_class->get_bounding_box = get_bounding_box;
   operation_class->prepare = prepare;
   operation_class->detect = detect;
-  /*operation_class->no_cache = TRUE;*/
+  /*operation_class->cache_policy = GEGL_CACHE_POLICY_NEVER;*/
 
   gegl_operation_class_set_keys (operation_class,
     "name",           "gegl:spyrograph",


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