Commit e7035da4 authored by Ell's avatar Ell

tests, examples: replace use of dont-cache with cache-policy

In tests/ and examples/, replace the use of the deprecated
GeglNode::dont-cache property with GeglNode::cache-policy.
parent 0f0d193a
......@@ -84,7 +84,7 @@ init_main_context (SDL_Surface *main_window, MainContext *context)
GeglColor *color2 = gegl_color_new ("rgb(0.6, 0.6, 0.6)");
GeglBuffer *paint_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, 0, 0), babl_format ("RGBA float"));
g_object_set (ptn, "dont-cache", TRUE, NULL);
g_object_set (ptn, "cache-policy", GEGL_CACHE_POLICY_NEVER, NULL);
/* Our graph represents a single drawing layer over a fixed background */
background_node = gegl_node_new_child (ptn,
......
......@@ -9,7 +9,7 @@ if __name__ == '__main__':
ptn = Gegl.Node()
# Disable caching on all child nodes
ptn.set_property("dont-cache", True)
ptn.set_property("cache-policy", Gegl.CachePolicy.NEVER)
# Create our background buffer. A gegl:color node would
# make more sense, we just use a buffer here as an example.
......
......@@ -26,14 +26,14 @@
int main(int argc, char *argv[])
{
int result = SUCCESS;
GeglNode *graph = NULL;
GeglNode *node = NULL;
GeglColor *color = NULL;
double x = -5;
double y = -5;
char *name = NULL;
gboolean cache = TRUE;
int result = SUCCESS;
GeglNode *graph = NULL;
GeglNode *node = NULL;
GeglColor *color = NULL;
double x = -5;
double y = -5;
char *name = NULL;
GeglCachePolicy cache_policy = GEGL_CACHE_POLICY_AUTO;
/* Init */
gegl_init (&argc, &argv);
......@@ -146,39 +146,39 @@ int main(int argc, char *argv[])
gegl_node_set (node,
"operation", "gegl:translate",
"name", "Brian",
"dont-cache", FALSE,
"cache-policy", GEGL_CACHE_POLICY_ALWAYS,
NULL);
gegl_node_get (node,
"name", &name,
"dont-cache", &cache,
"cache-policy", &cache_policy,
NULL);
if (!(!strcmp (name, "Brian") &&
cache == FALSE))
cache_policy == GEGL_CACHE_POLICY_ALWAYS))
{
result = FAILURE;
printf ("name: %s\n", name);
printf ("cache: %d\n", cache);
printf ("cache-policy: %d\n", cache_policy);
goto abort;
}
gegl_node_set (node,
"dont-cache", TRUE,
"cache-policy", GEGL_CACHE_POLICY_NEVER,
"name", "Steve",
NULL);
gegl_node_get (node,
"name", &name,
"dont-cache", &cache,
"cache-policy", &cache_policy,
NULL);
if (!(!strcmp (name, "Steve") &&
cache == TRUE))
cache_policy == GEGL_CACHE_POLICY_NEVER))
{
result = FAILURE;
printf ("name: %s\n", name);
printf ("cache: %d\n", cache);
printf ("cache-policy: %d\n", cache_policy);
goto abort;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment