[gegl] Make meta nodes return the cache of their proxy (bug 723365)
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Make meta nodes return the cache of their proxy (bug 723365)
- Date: Wed, 5 Feb 2014 09:40:36 +0000 (UTC)
commit 08d15cbf9ede65fe0b000ceff44f4bca16f137f0
Author: Daniel Sabo <DanielSabo gmail com>
Date: Tue Feb 4 11:23:17 2014 -0800
Make meta nodes return the cache of their proxy (bug 723365)
gegl/graph/gegl-node.c | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 937f503..c16f10b 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -1775,33 +1775,35 @@ GeglCache *
gegl_node_get_cache (GeglNode *node)
{
GeglPad *pad;
+ GeglNode *real_node;
const Babl *format = NULL;
g_return_val_if_fail (GEGL_IS_NODE (node), NULL);
- /* XXX: it should be possible to have cache for other pads than
- * only "output" pads
- */
pad = gegl_node_get_pad (node, "output");
- if (!pad)
- return NULL;
+ g_return_val_if_fail (pad, NULL);
+
+ real_node = gegl_pad_get_node (pad);
+
+ if (node != real_node)
+ return gegl_node_get_cache (real_node);
format = gegl_pad_get_format (pad);
- if (node->cache && format &&
- node->cache->format != format)
- {
- /* FIXME: Also cover output_format = NULL and cache->format != RGBA float */
- g_object_unref(node->cache);
- node->cache = NULL;
- }
+ if (!format)
+ {
+ g_warning ("Output of %s has no format", gegl_node_get_debug_name (node));
- if (!node->cache)
+ format = babl_format ("RGBA float");
+ }
+
+ if (node->cache && node->cache->format != format)
{
- if (!format)
- {
- format = babl_format ("RGBA float");
- }
+ g_object_unref (node->cache);
+ node->cache = NULL;
+ }
+ if (!node->cache)
+ {
node->cache = g_object_new (GEGL_TYPE_CACHE,
"format", format,
NULL);
@@ -1815,6 +1817,7 @@ gegl_node_get_cache (GeglNode *node)
(GCallback) gegl_node_computed_event,
node);
}
+
return node->cache;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]